diff --git a/config/ansible/tasks/docker.yml b/config/ansible/tasks/docker.yml index fd852a1..e4a22e3 100644 --- a/config/ansible/tasks/docker.yml +++ b/config/ansible/tasks/docker.yml @@ -4,15 +4,24 @@ changed_when: false failed_when: false +- name: Download Docker installation script + ansible.builtin.get_url: + url: https://get.docker.com + dest: /tmp/get-docker.sh + mode: '0755' + when: docker_check.rc != 0 + - name: Install Docker CE - ansible.builtin.shell: curl -fsSL https://get.docker.com | sh + ansible.builtin.shell: bash -c 'set -o pipefail && sh /tmp/get-docker.sh' + args: + creates: /usr/bin/docker when: docker_check.rc != 0 - name: Add user to docker group ansible.builtin.user: name: "{{ ansible_user }}" groups: docker - append: yes + append: true become: true when: docker_check.rc != 0 @@ -20,13 +29,13 @@ ansible.builtin.systemd: name: docker state: started - enabled: yes + enabled: true become: true register: docker_service - name: Reload systemd ansible.builtin.systemd: - daemon_reload: yes + daemon_reload: true become: true when: docker_service.changed @@ -34,7 +43,7 @@ ansible.builtin.systemd: name: docker state: started - enabled: yes + enabled: true become: true when: docker_service.changed - \ No newline at end of file + notify: Reload systemd diff --git a/config/ansible/tasks/gnome-extensions.yml b/config/ansible/tasks/gnome-extensions.yml index 248737a..fd103be 100644 --- a/config/ansible/tasks/gnome-extensions.yml +++ b/config/ansible/tasks/gnome-extensions.yml @@ -1,2 +1,2 @@ - name: Install Pano - Clipboard Manager - import_tasks: tasks/gnome-extensions/pano.yml \ No newline at end of file + ansible.builtin.import_tasks: tasks/gnome-extensions/pano.yml diff --git a/config/ansible/tasks/gnome-extensions/pano.yml b/config/ansible/tasks/gnome-extensions/pano.yml index c9f28f1..09c9318 100644 --- a/config/ansible/tasks/gnome-extensions/pano.yml +++ b/config/ansible/tasks/gnome-extensions/pano.yml @@ -8,7 +8,7 @@ path: "{{ ansible_user_dir }}/.local/share/gnome-shell/extensions/pano@elhan.io" state: directory mode: '0755' - when: pano_check.stat.exists == False + when: not pano_check.stat.exists # To update Pano, delete the existing directory and re-download the latest release # Replace the URL with the latest release URL and rerun the playbook/dotf update @@ -16,22 +16,25 @@ ansible.builtin.get_url: url: https://github.com/oae/gnome-shell-pano/releases/download/v23-alpha3/pano@elhan.io.zip dest: "{{ ansible_user_dir }}/.local/share/gnome-shell/extensions/pano@elhan.io/release.zip" - when: pano_check.stat.exists == False + mode: '0644' + when: not pano_check.stat.exists - name: Extract Pano - Clipboard Manager ansible.builtin.unarchive: src: "{{ ansible_user_dir }}/.local/share/gnome-shell/extensions/pano@elhan.io/release.zip" dest: "{{ ansible_user_dir }}/.local/share/gnome-shell/extensions/pano@elhan.io/" - when: pano_check.stat.exists == False + when: not pano_check.stat.exists - name: Cleanup post Pan - Clipboard Manager installation ansible.builtin.file: path: "{{ ansible_user_dir }}/.local/share/gnome-shell/extensions/pano@elhan.io/release.zip" state: absent - when: pano_check.stat.exists == False + when: not pano_check.stat.exists - name: Notify user of required GNOME Shell extension reload ansible.builtin.debug: - msg: "Please reload GNOME Shell by pressing Alt + F2, typing 'r' and pressing Enter. Then enable the Pano - Clipboard Manager extension in GNOME Tweaks. Or on Wayland, log out and back in." - when: pano_check.stat.exists == False - + msg: > + Please reload GNOME Shell by pressing Alt + F2, typing 'r' and pressing Enter. + Then enable the Pano - Clipboard Manager extension in GNOME Tweaks. + Or on Wayland, log out and back in. + when: not pano_check.stat.exists diff --git a/config/ansible/tasks/rust.yml b/config/ansible/tasks/rust.yml index 5744935..ecdb34d 100644 --- a/config/ansible/tasks/rust.yml +++ b/config/ansible/tasks/rust.yml @@ -6,15 +6,17 @@ args: executable: /bin/bash +- name: Download Rust installation script + ansible.builtin.get_url: + url: https://sh.rustup.rs + dest: /tmp/rustup.sh + mode: '0755' + when: rust_check.rc != 0 + - name: Install Rust and Cargo - shell: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + ansible.builtin.shell: | + set -o pipefail + /tmp/rustup.sh -y args: creates: ~/.cargo/bin/rustc when: rust_check.rc != 0 - -- name: Add Cargo to PATH - ansible.builtin.lineinfile: - path: ~/.bashrc - line: 'source $HOME/.cargo/env' - create: yes - when: rust_check.rc != 0