]> git.immae.eu Git - perso/Immae/Config/Ansible.git/commitdiff
Replace synchronize wiht copy
authorIsmaël Bouya <ismael.bouya@fretlink.com>
Sat, 10 Nov 2018 12:15:21 +0000 (13:15 +0100)
committerIsmaël Bouya <ismael.bouya@fretlink.com>
Sat, 10 Nov 2018 12:15:21 +0000 (13:15 +0100)
roles/contexts/fretlink/tasks/main.yml
roles/git/tasks/main.yml
roles/gnupg/tasks/main.yml
roles/graphical/tasks/main.yml
roles/lxde/tasks/main.yml
roles/programming/haskell/tasks/main.yml
roles/tools/tasks/main.yml

index b1b163a5912f911a980424f7a9bc36d1d4f57257..57d332e4d8aeb0767723616c03ebf78ef269643b 100644 (file)
@@ -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
 - 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
index 440e1789cc0b459869f72b10d7b6340dd3515a09..e2a5bbf84ff7adfa9d6059eec00668e2813c6663 100644 (file)
@@ -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
index 2bd1c79ad7e0cfd8ded167909214c8acc4f33bc9..183dd7dd243d5b406c047fb1fed1df43be9fb6f1 100644 (file)
@@ -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 }}"
   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
         - 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
index 96c70b93e79f36f9daaff2b49835cb51fddb38ec..ad4502451d9560eb377bf961742c452879e9fd60 100644 (file)
@@ -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
index b48b5e56c75fc53a1e069f9a65cf8f7c7c806936..16607874335e809490e0932dfb11ee5048fd306a 100644 (file)
@@ -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
index cd6654bb47635c6cc925aa79bc530ecf2124021e..fe37787f5ebef51b39068db2b42134977e1cc978 100644 (file)
@@ -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
index 745a08fbe5257698179cf1e24ff202719315f873..9d23619fd5b8947eb8bd98770686015a4c1c5340 100644 (file)
@@ -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
     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"