From eac82f289d503c5bcc0d1e04784d027745d371c6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Sat, 10 Nov 2018 13:15:21 +0100 Subject: [PATCH] Replace synchronize wiht copy --- roles/contexts/fretlink/tasks/main.yml | 25 +++++++++-------------- roles/git/tasks/main.yml | 15 ++++++++------ roles/gnupg/tasks/main.yml | 26 ++++++++++++++++-------- roles/graphical/tasks/main.yml | 13 ++++++------ roles/lxde/tasks/main.yml | 25 +++++++++++++++++------ roles/programming/haskell/tasks/main.yml | 16 ++++++++------- roles/tools/tasks/main.yml | 13 ++++++------ 7 files changed, 78 insertions(+), 55 deletions(-) diff --git a/roles/contexts/fretlink/tasks/main.yml b/roles/contexts/fretlink/tasks/main.yml index b1b163a..57d332e 100644 --- a/roles/contexts/fretlink/tasks/main.yml +++ b/roles/contexts/fretlink/tasks/main.yml @@ -7,12 +7,11 @@ - programming/haskell - programming/nodejs - name: Config files - synchronize: - recursive: yes - archive: no - checksum: yes - src: config_files/ - dest: /$XDG_CONFIG_HOME/ + copy: + src: "config_files/{{ item }}" + dest: "$XDG_CONFIG_HOME/{{ item }}" + loop: + - "autostart/zeal.desktop" - name: Create pm2 config dir file: path: $XDG_CONFIG_HOME/pm2 @@ -20,16 +19,12 @@ - name: workdir block: - name: workdir scripts - synchronize: - recursive: yes - archive: no - checksum: yes - src: workdir/ - dest: /$HOME/workdir/ - - name: chmod workdir script - file: - path: $HOME/workdir/start + copy: mode: 0755 + src: "workdir/{{ item }}" + dest: "$HOME/workdir/{{ item }}" + loop: + - start - name: environment variables file block: - name: extract environment diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml index 440e178..e2a5bbf 100644 --- a/roles/git/tasks/main.yml +++ b/roles/git/tasks/main.yml @@ -1,11 +1,14 @@ --- - name: Config files - synchronize: - recursive: yes - archive: no - checksum: yes - src: config_files/ - dest: /$XDG_CONFIG_HOME/ + copy: + mode: preserve + src: "config_files/{{ config_item }}" + dest: "$XDG_CONFIG_HOME/{{ config_item }}" + loop: + - tig/config + - git/templates_fretlink/hooks/pre-push + loop_control: + loop_var: config_item - name: git config file template: src: config.j2 diff --git a/roles/gnupg/tasks/main.yml b/roles/gnupg/tasks/main.yml index 2bd1c79..183dd7d 100644 --- a/roles/gnupg/tasks/main.yml +++ b/roles/gnupg/tasks/main.yml @@ -1,11 +1,13 @@ --- - name: Config files - synchronize: - recursive: yes - archive: no - checksum: yes - src: gnupg - dest: /$XDG_CONFIG_HOME/ + copy: + src: "gnupg/{{ gnupg_config_item }}" + dest: "$XDG_CONFIG_HOME/gnupg/{{ gnupg_config_item }}" + loop: + - gpg-agent.conf + - gpg.conf + loop_control: + loop_var: gnupg_config_item - name: Protect directory file: path: $XDG_CONFIG_HOME/gnupg @@ -63,6 +65,7 @@ - notify add key to immae@immae.eu - send key to immae@immae.eu - notify add key to password store +- meta: flush_handlers - name: add keygrip to sshcontrol lineinfile: line: "{{ keygrip.stdout }}" @@ -73,12 +76,13 @@ when: keygrip is defined and "stdout" in keygrip and keygrip.stdout != "" notify: - restart gpg-agent +- meta: flush_handlers - name: Override the gpg socket directory block: - name: Add systemd overrides template: - src: "systemd/{{ item }}.conf.j2" - dest: "$XDG_CONFIG_HOME/systemd/user/{{ item }}.socket.d/override.conf" + src: "systemd/{{ systemd_item }}.conf.j2" + dest: "$XDG_CONFIG_HOME/systemd/user/{{ systemd_item }}.socket.d/override.conf" register: results loop: - dirmngr @@ -86,10 +90,14 @@ - gpg-agent-browser - gpg-agent-extra - gpg-agent-ssh + loop_control: + loop_var: systemd_item - name: Restart systemd units systemd: daemon_reload: true scope: user state: restarted - name: "{{ item }}.socket" + name: "{{ restart_systemd_item }}.socket" loop: "{{ results.results|selectattr('changed')|map(attribute='item')|list }}" + loop_control: + loop_var: restart_systemd_item diff --git a/roles/graphical/tasks/main.yml b/roles/graphical/tasks/main.yml index 96c70b9..ad45024 100644 --- a/roles/graphical/tasks/main.yml +++ b/roles/graphical/tasks/main.yml @@ -1,11 +1,12 @@ --- - name: Config files - synchronize: - recursive: yes - archive: no - checksum: yes - src: config_files/ - dest: /$XDG_CONFIG_HOME/ + copy: + src: "config_files/{{ item }}" + dest: "$XDG_CONFIG_HOME/{{ item }}" + loop: + - redshift.conf + - autostart/redshift-gtk.desktop + - dunst/dunstrc - name: mimeapps file copy: src: mimeapps.list diff --git a/roles/lxde/tasks/main.yml b/roles/lxde/tasks/main.yml index b48b5e5..1660787 100644 --- a/roles/lxde/tasks/main.yml +++ b/roles/lxde/tasks/main.yml @@ -3,9 +3,22 @@ include_role: name: graphical - name: Config files - synchronize: - recursive: yes - archive: no - checksum: yes - src: config_files/ - dest: /$XDG_CONFIG_HOME/ + copy: + mode: preserve + src: "config_files/{{ lxde_config_item }}" + dest: "$XDG_CONFIG_HOME/{{ lxde_config_item }}" + loop: + - libfm/libfm.conf + - pcmanfm/LXDE/desktop-items-0.conf + - pcmanfm/LXDE/pcmanfm.conf + - lxterminal/lxterminal.conf + - openbox/lxde-rc.xml + - lxpanel/LXDE/panels/panel + - lxpanel/LXDE/config + - lxpanel/launchtaskbar.cfg + - lxsession-default-apps/settings.conf + - lxsession/LXDE/autostart + - lxsession/LXDE/desktop.conf + - xinitrc + loop_control: + loop_var: lxde_config_item diff --git a/roles/programming/haskell/tasks/main.yml b/roles/programming/haskell/tasks/main.yml index cd6654b..fe37787 100644 --- a/roles/programming/haskell/tasks/main.yml +++ b/roles/programming/haskell/tasks/main.yml @@ -4,10 +4,12 @@ src: ghci.conf dest: $HOME/.ghc/ - name: Stack config files - synchronize: - recursive: yes - archive: no - checksum: yes - src: stack/ - dest: /$XDG_DATA_HOME/stack/ - + copy: + src: "stack/{{ stack_item }}" + dest: "$XDG_DATA_HOME/stack/{{ stack_item }}" + loop: + - config.yaml + - global-project/README.txt + - global-project/stack.yaml + loop_control: + loop_var: stack_item diff --git a/roles/tools/tasks/main.yml b/roles/tools/tasks/main.yml index 745a08f..9d23619 100644 --- a/roles/tools/tasks/main.yml +++ b/roles/tools/tasks/main.yml @@ -25,6 +25,7 @@ dest: $XDG_CONFIG_HOME/vim/vimrc notify: - run PlugInstall +- meta: flush_handlers - name: tmux config file template: src: tmux.conf.j2 @@ -34,18 +35,18 @@ src: youtube-viewer.conf.j2 dest: $XDG_CONFIG_HOME/youtube-viewer/youtube-viewer.conf - name: remind config file - synchronize: - recursive: yes - archive: no - checksum: yes - src: remind/commands/ - dest: /$XDG_CONFIG_HOME/remind/ + copy: + src: "remind/commands/{{ item }}" + dest: "$XDG_CONFIG_HOME/remind/{{ item }}" + loop: + - work - name: remind service file copy: src: remind/remind@.service dest: $XDG_CONFIG_HOME/systemd/user/ notify: - reload systemd +- meta: flush_handlers - name: Clone password store git: dest: "$XDG_DATA_HOME/pass" -- 2.41.0