From da7630973c4dae9cc351ea2ff1491ec42c1ba593 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Wed, 7 Nov 2018 10:49:21 +0100 Subject: [PATCH 1/4] Fix(arch_aur): fix become_user --- tasks/arch_aur.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/arch_aur.yml b/tasks/arch_aur.yml index c21eef4..33b7529 100644 --- a/tasks/arch_aur.yml +++ b/tasks/arch_aur.yml @@ -16,6 +16,7 @@ dest: ~/.ansible/plugins/modules/aur version: master accept_hostkey: yes + become: yes become_user: aur_builder - name: Install Yay From 95205bcd7880f0b410115f51d25c3d9888e8fae4 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Wed, 7 Nov 2018 10:50:20 +0100 Subject: [PATCH 2/4] tmp(Choux): remove arch_aur in choux --- Choux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Choux.yml b/Choux.yml index 42881fa..69358e9 100644 --- a/Choux.yml +++ b/Choux.yml @@ -14,7 +14,7 @@ - include: tasks/sudo.yml - include: tasks/ssh.yml - include: tasks/arch_python.yml - - include: tasks/arch_aur.yml + # - include: tasks/arch_aur.yml - include: tasks/arch_gnome.yml - include: tasks/arch_graphicals.yml - include: tasks/dotfiles.yml From 40f7f91e720f3bdb9cd7e8cd899574ebf9e7a699 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Wed, 7 Nov 2018 10:57:55 +0100 Subject: [PATCH 3/4] Feat(choux): add first_deployement tag --- Choux.yml | 2 +- tasks/arch_CLI_packages.yml | 4 ++++ tasks/arch_aur.yml | 6 ++++++ tasks/ssh.yml | 10 ++++++++++ tasks/sudo.yml | 6 ++++++ tasks/users.yml | 4 ++++ tasks/zsh.yml | 26 ++++++++++++++------------ 7 files changed, 45 insertions(+), 13 deletions(-) diff --git a/Choux.yml b/Choux.yml index 69358e9..42881fa 100644 --- a/Choux.yml +++ b/Choux.yml @@ -14,7 +14,7 @@ - include: tasks/sudo.yml - include: tasks/ssh.yml - include: tasks/arch_python.yml - # - include: tasks/arch_aur.yml + - include: tasks/arch_aur.yml - include: tasks/arch_gnome.yml - include: tasks/arch_graphicals.yml - include: tasks/dotfiles.yml diff --git a/tasks/arch_CLI_packages.yml b/tasks/arch_CLI_packages.yml index 93b388a..caa21b5 100644 --- a/tasks/arch_CLI_packages.yml +++ b/tasks/arch_CLI_packages.yml @@ -3,6 +3,8 @@ pacman: update_cache: yes upgrade: yes + tags: + - first_deployement - name: Install base CLI packages pacman: @@ -30,6 +32,8 @@ - autofs - bind-tools state: present + tags: + - first_deployement - name: Install extra CLI packages pacman: diff --git a/tasks/arch_aur.yml b/tasks/arch_aur.yml index 33b7529..df786d8 100644 --- a/tasks/arch_aur.yml +++ b/tasks/arch_aur.yml @@ -2,6 +2,8 @@ - user: name: aur_builder group: wheel + tags: + - first_deployement - lineinfile: path: /etc/sudoers.d/11-install-aur_builder @@ -9,6 +11,8 @@ line: 'aur_builder ALL=(ALL) NOPASSWD: /usr/bin/pacman' create: yes validate: 'visudo -cf %s' + tags: + - first_deployement - name: Git clone ansible-aur git: @@ -18,6 +22,8 @@ accept_hostkey: yes become: yes become_user: aur_builder + tags: + - first_deployement - name: Install Yay aur: diff --git a/tasks/ssh.yml b/tasks/ssh.yml index 265f428..db41fa5 100644 --- a/tasks/ssh.yml +++ b/tasks/ssh.yml @@ -10,6 +10,8 @@ regexp: "^#?PermitEmptyPasswords" line: "PermitEmptyPasswords no" backrefs: yes + tags: + - first_deployement - name: Disable remote root login lineinfile: @@ -17,6 +19,8 @@ regexp: "^#?PermitRootLogin" line: "PermitRootLogin no" backrefs: yes + tags: + - first_deployement - name: Add public key for deploy user authorized_key: @@ -25,6 +29,8 @@ state: present with_items: "{{ deploy_users }}" register: add_identity_key + tags: + - first_deployement - name: Disable password login lineinfile: @@ -34,10 +40,14 @@ backrefs: yes when: add_identity_key is succeeded and not add_identity_key is skipped notify: restart sshd + tags: + - first_deployement - name: Enable SSH daemon service: name: sshd state: started enabled: yes + tags: + - first_deployement diff --git a/tasks/sudo.yml b/tasks/sudo.yml index b285cc7..e589ef5 100644 --- a/tasks/sudo.yml +++ b/tasks/sudo.yml @@ -4,11 +4,15 @@ src: files/sudoers dest: /etc/sudoers mode: 0440 + tags: + - first_deployement - name: Create sudo group group: name: sudo state: present + tags: + - first_deployement - name: Add deploy user to sudo group user: @@ -16,3 +20,5 @@ groups: sudo append: yes with_items: '{{ deploy_users }}' + tags: + - first_deployement diff --git a/tasks/users.yml b/tasks/users.yml index d2db4b0..d4afa89 100644 --- a/tasks/users.yml +++ b/tasks/users.yml @@ -6,6 +6,8 @@ uid: "{{ item.uid }}" shell: /bin/zsh with_items: "{{ deploy_users }}" + tags: + - first_deployement - name: Add me user: @@ -15,4 +17,6 @@ shell: /bin/zsh with_items: "{{ me }}" when: not minimal or not server + tags: + - first_deployement diff --git a/tasks/zsh.yml b/tasks/zsh.yml index f1f6334..fa3864c 100644 --- a/tasks/zsh.yml +++ b/tasks/zsh.yml @@ -1,19 +1,21 @@ --- -- name: download default grml configuration - get_url: - url: http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc - dest: /etc/zsh/newuser.zshrc.recommended - backup: yes - -- name: download default grml configuration - get_url: - url: http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc - dest: /etc/zsh/zshrc - force: yes - backup: yes +# - name: download default grml configuration +# get_url: +# url: http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc +# dest: /etc/zsh/newuser.zshrc.recommended +# backup: yes +# +# - name: download default grml configuration +# get_url: +# url: http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc +# dest: /etc/zsh/zshrc +# force: yes +# backup: yes - name: Set shell for root to zsh user: name: root shell: /bin/zsh + tags: + - first_deployement From 063483579e14d81c78b60d3275740cbba7255e07 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Wed, 7 Nov 2018 11:37:28 +0100 Subject: [PATCH 4/4] Doc(Choux): Add aur module in Choux install --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 864def7..915c3a1 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ Before call ansible-pull, git and ansible are required Installing Choux + # Need aur module for some tasks + git clone https://github.com/kewlfft/ansible-aur.git ~/.ansible/plugins/modules/aur ansible-pull -U https://git.opytex.org/lafrite/Ansible_workstation.git Choux.yml Installing Songe