Make unchanged tasks in vim role not report changed
This commit is contained in:
parent
d845af7949
commit
d800e77ac7
1 changed files with 20 additions and 3 deletions
|
@ -38,11 +38,17 @@
|
||||||
when: ansible_facts['distribution'] == 'Archlinux'
|
when: ansible_facts['distribution'] == 'Archlinux'
|
||||||
changed_when: "'there is nothing to do' not in shellcheck_script.stdout"
|
changed_when: "'there is nothing to do' not in shellcheck_script.stdout"
|
||||||
|
|
||||||
- name: Remove ~/.vim/colors/ directory
|
- name: Check if colors is a symlink
|
||||||
|
stat:
|
||||||
|
path: ~/.vim/colors
|
||||||
|
follow: false
|
||||||
|
register: colors_dir
|
||||||
|
|
||||||
|
- name: Remove colors symlink
|
||||||
file:
|
file:
|
||||||
path: ~/.vim/colors
|
path: ~/.vim/colors
|
||||||
state: absent
|
state: absent
|
||||||
changed_when: false
|
when: colors_dir.stat.exists and colors_dir.stat.islnk
|
||||||
|
|
||||||
- name: Copy configs
|
- name: Copy configs
|
||||||
copy: src={{ item.src }} dest={{ item.dest }}
|
copy: src={{ item.src }} dest={{ item.dest }}
|
||||||
|
@ -50,7 +56,7 @@
|
||||||
- { src: 'flake8', dest: '~/.flake8' }
|
- { src: 'flake8', dest: '~/.flake8' }
|
||||||
- { src: 'pylintrc', dest: '~/.pylintrc' }
|
- { src: 'pylintrc', dest: '~/.pylintrc' }
|
||||||
- { src: 'vimrc', dest: '~/.vimrc' }
|
- { src: 'vimrc', dest: '~/.vimrc' }
|
||||||
- { src: 'colors/', dest: '~/.vim/colors/' }
|
- { src: 'colors', dest: '~/.vim/' }
|
||||||
|
|
||||||
- name: Check if vim-plug is installed
|
- name: Check if vim-plug is installed
|
||||||
stat:
|
stat:
|
||||||
|
@ -65,28 +71,39 @@
|
||||||
command:
|
command:
|
||||||
cmd: vim +PlugUpgrade +qall
|
cmd: vim +PlugUpgrade +qall
|
||||||
stdin: '\n' # When an error with vimrc is encountered, needs user input to continue
|
stdin: '\n' # When an error with vimrc is encountered, needs user input to continue
|
||||||
|
register: result
|
||||||
|
changed_when: "'vim-plug is already up-to-date' not in result.stdout"
|
||||||
|
|
||||||
- name: Install plugins
|
- name: Install plugins
|
||||||
command:
|
command:
|
||||||
cmd: vim +PlugInstall +qall
|
cmd: vim +PlugInstall +qall
|
||||||
stdin: '\n' # When an error with vimrc is encountered, needs user input to continue
|
stdin: '\n' # When an error with vimrc is encountered, needs user input to continue
|
||||||
|
register: result
|
||||||
|
changed_when: "'Resolving deltas' in result.stdout"
|
||||||
|
|
||||||
- name: Update plugins
|
- name: Update plugins
|
||||||
command:
|
command:
|
||||||
cmd: vim +PlugUpdate +qall
|
cmd: vim +PlugUpdate +qall
|
||||||
stdin: '\n' # When an error with vimrc is encountered, needs user input to continue
|
stdin: '\n' # When an error with vimrc is encountered, needs user input to continue
|
||||||
|
register: result
|
||||||
|
changed_when: "'files changed' in result.stdout"
|
||||||
|
|
||||||
- name: Update Coc plugins
|
- name: Update Coc plugins
|
||||||
command:
|
command:
|
||||||
cmd: vim +CocUpdate +qall
|
cmd: vim +CocUpdate +qall
|
||||||
stdin: '\n' # When an error with vimrc is encountered, needs user input to continue
|
stdin: '\n' # When an error with vimrc is encountered, needs user input to continue
|
||||||
|
register: result
|
||||||
|
changed_when: "'Updated' in result.stdout"
|
||||||
|
|
||||||
- name: Upgrade Black
|
- name: Upgrade Black
|
||||||
command:
|
command:
|
||||||
cmd: vim +BlackUpgrade +qall
|
cmd: vim +BlackUpgrade +qall
|
||||||
stdin: '\n' # When an error with vimrc is encountered, needs user input to continue
|
stdin: '\n' # When an error with vimrc is encountered, needs user input to continue
|
||||||
|
register: result
|
||||||
|
|
||||||
- name: Install hdl-checker
|
- name: Install hdl-checker
|
||||||
pip:
|
pip:
|
||||||
name: hdl-checker
|
name: hdl-checker
|
||||||
extra_args: --user
|
extra_args: --user
|
||||||
|
register: result
|
||||||
|
changed_when: "'Running setup.py install for hdl-checker' in result.stdout"
|
||||||
|
|
Loading…
Add table
Reference in a new issue