From: Ismaël Bouya Date: Tue, 6 Nov 2018 18:05:00 +0000 (+0100) Subject: Use check_mode for commands X-Git-Tag: v1.0~38 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=d03cede672edcf559379ca0b12c80fd7b92cfb18;p=perso%2FImmae%2FConfig%2FAnsible.git Use check_mode for commands --- diff --git a/roles/gnupg/tasks/main.yml b/roles/gnupg/tasks/main.yml index d1289f5..ef61fed 100644 --- a/roles/gnupg/tasks/main.yml +++ b/roles/gnupg/tasks/main.yml @@ -15,11 +15,13 @@ shell: 'gpgconf --list-dirs socketdir | sed -e "s@$XDG_RUNTIME_DIR/gnupg/@@"' register: gnupg_runtime_dir_cmd changed_when: false + check_mode: no - name: check existing secret key shell: "gpg --list-secret-keys | grep '{{ gpg_useremail }}'" changed_when: false ignore_errors: true register: gpgkeys + check_mode: no - name: ask for gpg password pause: prompt: "Chose gpg password" diff --git a/roles/gnupg/templates/systemd/dirmngr.conf.j2 b/roles/gnupg/templates/systemd/dirmngr.conf.j2 index 9083ab5..529fdd7 100644 --- a/roles/gnupg/templates/systemd/dirmngr.conf.j2 +++ b/roles/gnupg/templates/systemd/dirmngr.conf.j2 @@ -1,3 +1,3 @@ [Socket] ListenStream= -ListenStream=%t/gnupg/{{ gnupg_runtime_dir_cmd.get('stdout', debug_gnupg_runtime_dir) }}/S.dirmngr +ListenStream=%t/gnupg/{{ gnupg_runtime_dir_cmd.stdout }}/S.dirmngr diff --git a/roles/gnupg/templates/systemd/gpg-agent-browser.conf.j2 b/roles/gnupg/templates/systemd/gpg-agent-browser.conf.j2 index 61ddeb6..6dbbbc7 100644 --- a/roles/gnupg/templates/systemd/gpg-agent-browser.conf.j2 +++ b/roles/gnupg/templates/systemd/gpg-agent-browser.conf.j2 @@ -1,3 +1,3 @@ [Socket] ListenStream= -ListenStream=%t/gnupg/{{ gnupg_runtime_dir_cmd.get('stdout', debug_gnupg_runtime_dir) }}/S.gpg-agent.browser +ListenStream=%t/gnupg/{{ gnupg_runtime_dir_cmd.stdout }}/S.gpg-agent.browser diff --git a/roles/gnupg/templates/systemd/gpg-agent-extra.conf.j2 b/roles/gnupg/templates/systemd/gpg-agent-extra.conf.j2 index f34606c..fbd5dee 100644 --- a/roles/gnupg/templates/systemd/gpg-agent-extra.conf.j2 +++ b/roles/gnupg/templates/systemd/gpg-agent-extra.conf.j2 @@ -1,3 +1,3 @@ [Socket] ListenStream= -ListenStream=%t/gnupg/{{ gnupg_runtime_dir_cmd.get('stdout', debug_gnupg_runtime_dir) }}/S.gpg-agent.extra +ListenStream=%t/gnupg/{{ gnupg_runtime_dir_cmd.stdout }}/S.gpg-agent.extra diff --git a/roles/gnupg/templates/systemd/gpg-agent-ssh.conf.j2 b/roles/gnupg/templates/systemd/gpg-agent-ssh.conf.j2 index b7cd0c2..6f37eaa 100644 --- a/roles/gnupg/templates/systemd/gpg-agent-ssh.conf.j2 +++ b/roles/gnupg/templates/systemd/gpg-agent-ssh.conf.j2 @@ -1,3 +1,3 @@ [Socket] ListenStream= -ListenStream=%t/gnupg/{{ gnupg_runtime_dir_cmd.get('stdout', debug_gnupg_runtime_dir) }}/S.gpg-agent.ssh +ListenStream=%t/gnupg/{{ gnupg_runtime_dir_cmd.stdout }}/S.gpg-agent.ssh diff --git a/roles/gnupg/templates/systemd/gpg-agent.conf.j2 b/roles/gnupg/templates/systemd/gpg-agent.conf.j2 index 666c22e..4f085da 100644 --- a/roles/gnupg/templates/systemd/gpg-agent.conf.j2 +++ b/roles/gnupg/templates/systemd/gpg-agent.conf.j2 @@ -1,3 +1,3 @@ [Socket] ListenStream= -ListenStream=%t/gnupg/{{ gnupg_runtime_dir_cmd.get('stdout', debug_gnupg_runtime_dir) }}/S.gpg-agent +ListenStream=%t/gnupg/{{ gnupg_runtime_dir_cmd.stdout }}/S.gpg-agent diff --git a/roles/init/tasks/main.yml b/roles/init/tasks/main.yml index edbd820..ce56ec4 100644 --- a/roles/init/tasks/main.yml +++ b/roles/init/tasks/main.yml @@ -3,6 +3,7 @@ shell: 'GNUPGHOME=$XDG_CONFIG_HOME/gnupg gpgconf --list-dirs socketdir | sed -e "s@$XDG_RUNTIME_DIR/gnupg/@@"' changed_when: false register: gnupg_runtime_dir_cmd + check_mode: no - name: Add pam_environment register: pam_environment template: diff --git a/roles/init/templates/pam_environment.j2 b/roles/init/templates/pam_environment.j2 index 4327eeb..fc65a10 100644 --- a/roles/init/templates/pam_environment.j2 +++ b/roles/init/templates/pam_environment.j2 @@ -38,7 +38,7 @@ GNUPGHOME DEFAULT="${XDG_CONFIG_HOME}/gnupg" # SSH SSH_AGENT_PID DEFAULT= -SSH_AUTH_SOCK DEFAULT="${XDG_RUNTIME_DIR}/gnupg/{{ gnupg_runtime_dir_cmd.get('stdout', debug_gnupg_runtime_dir) }}/S.gpg-agent.ssh" +SSH_AUTH_SOCK DEFAULT="${XDG_RUNTIME_DIR}/gnupg/{{ gnupg_runtime_dir_cmd.stdout }}/S.gpg-agent.ssh" # Less LESSHISTFILE DEFAULT="${XDG_STATE_HOME}/less/history" diff --git a/roles/tools/handlers/main.yml b/roles/tools/handlers/main.yml index a282512..a050b9b 100644 --- a/roles/tools/handlers/main.yml +++ b/roles/tools/handlers/main.yml @@ -3,3 +3,5 @@ systemd: daemon_reload: true scope: user +- name: run PlugInstall + shell: vim -c PlugInstall -c qa diff --git a/roles/tools/tasks/main.yml b/roles/tools/tasks/main.yml index fe5b023..70bba9d 100644 --- a/roles/tools/tasks/main.yml +++ b/roles/tools/tasks/main.yml @@ -18,13 +18,11 @@ path: $XDG_STATE_HOME/psql state: directory - name: vim config file - register: vim_result copy: src: vimrc dest: $XDG_CONFIG_HOME/vim/vimrc -- name: run PlugInstall - shell: vim -c PlugInstall -c qa - when: vim_result.changed + notify: + - run PlugInstall - name: tmux config file template: src: tmux.conf.j2 diff --git a/site.yml b/site.yml index 3d5a8d7..f05b960 100644 --- a/site.yml +++ b/site.yml @@ -4,7 +4,6 @@ gpg_useremail: "ismael@flony" gpg_realname: "Ismaël Bouya" gpg_user: "ismael" - debug_gnupg_runtime_dir: "d.sa5ao9hmm8xbjif73e5hcsfs" profile: "flony" role: flony: "fretlink"