From dd2e1e67a228655e8121c5d70b1fa8b6451760a3 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Mon, 24 Feb 2020 06:35:41 +0100 Subject: [PATCH 1/7] Feat: create_user var --- Choux.yml | 2 +- tasks/users.yml | 2 ++ vars/common.yml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Choux.yml b/Choux.yml index ce768d5..4d7236a 100644 --- a/Choux.yml +++ b/Choux.yml @@ -15,7 +15,7 @@ - include: tasks/pacman_cache_server.yml - include: tasks/arch_CLI_packages.yml - include: tasks/prompt.yml - # - include: tasks/users.yml + - include: tasks/users.yml - include: tasks/sudo.yml - include: tasks/ssh.yml - include: tasks/arch_programming.yml diff --git a/tasks/users.yml b/tasks/users.yml index e77732a..5e95c0e 100644 --- a/tasks/users.yml +++ b/tasks/users.yml @@ -14,6 +14,7 @@ shell: "{{ prompt_place['stdout'] }}" state: present with_items: "{{ deploy_users }}" + when: create_user - name: Add me user: @@ -24,3 +25,4 @@ shell: "{{ prompt_place['stdout'] }}" state: present with_items: "{{ me }}" + when: create_user diff --git a/vars/common.yml b/vars/common.yml index fc181d2..0ed9b2d 100644 --- a/vars/common.yml +++ b/vars/common.yml @@ -17,4 +17,5 @@ prompt: 'fish' minimal: false server: false +create_user: false From 6d289231dd89dbdfaf8f4bac224c19d1cc0124b0 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Mon, 24 Feb 2020 06:55:28 +0100 Subject: [PATCH 2/7] Feat: add BV_boutique --- BV_boutique.yml | 24 ++++++++++++++++++++++++ tasks/dotfiles.yml | 4 ++++ vars/BV_boutique.yml | 9 +++++++++ 3 files changed, 37 insertions(+) create mode 100644 BV_boutique.yml create mode 100644 vars/BV_boutique.yml diff --git a/BV_boutique.yml b/BV_boutique.yml new file mode 100644 index 0000000..fc8e67f --- /dev/null +++ b/BV_boutique.yml @@ -0,0 +1,24 @@ +--- +- hosts: localhost + connection: local + + vars_files: + - vars/common.yml + - vars/server.yml + - vars/BV_boutique.yml.yml + + tasks: + - include: tasks/ansible.yml + - include: tasks/deb_CLI_packages.yml + - include: tasks/prompt.yml + - include: tasks/users.yml + - include: tasks/sudo.yml + - include: tasks/ssh.yml + - include: tasks/dotfiles.yml + - include: tasks/deb_docker.yml + + handlers: + - name: restart sshd + service: + name: sshd + state: restarted diff --git a/tasks/dotfiles.yml b/tasks/dotfiles.yml index df4c724..7a3566d 100644 --- a/tasks/dotfiles.yml +++ b/tasks/dotfiles.yml @@ -119,6 +119,7 @@ owner: "{{ item.username }}" group: "{{ item.group }}" with_items: "{{ me }}" + when: not server - name: Copy ssh user config template: @@ -127,6 +128,7 @@ owner: "{{ item.username }}" group: "{{ item.group }}" with_items: "{{ deploy_users }}" + when: not server - name: Copy ssh user config template: @@ -135,6 +137,7 @@ owner: "{{ item.username }}" group: "{{ item.group }}" with_items: "{{ me }}" + when: not server # Git config - name: Copy gitconfig @@ -144,3 +147,4 @@ owner: "{{ item.username }}" group: "{{ item.group }}" with_items: "{{ me }}" + when: not server diff --git a/vars/BV_boutique.yml b/vars/BV_boutique.yml new file mode 100644 index 0000000..d5ec5ec --- /dev/null +++ b/vars/BV_boutique.yml @@ -0,0 +1,9 @@ +--- +deploy_public_key: id_rsa_manioc.pub + +deploy_users: + - username: 'waha' + password: '$6$tQLlZ3lI/NDcT3.C$VCBzrpNxDgOK7b2que2/BnAYWl.zKVugZrQEPxtsq3iWcskEzQ1NvytZRXkB4GCDa/xEohxiodyCaZyFnhxby1' + uid: '999' + group: wheel + groups: sudo From a5ba3cc48a272386bd08617bf51cb0d4ebf75174 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Mon, 24 Feb 2020 06:59:32 +0100 Subject: [PATCH 3/7] Fix: double yml --- BV_boutique.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BV_boutique.yml b/BV_boutique.yml index fc8e67f..f881f99 100644 --- a/BV_boutique.yml +++ b/BV_boutique.yml @@ -5,7 +5,7 @@ vars_files: - vars/common.yml - vars/server.yml - - vars/BV_boutique.yml.yml + - vars/BV_boutique.yml tasks: - include: tasks/ansible.yml From 09c89e092ac11252e6897446643f1e1e6742e435 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Mon, 24 Feb 2020 07:06:06 +0100 Subject: [PATCH 4/7] Fix: remove loop for apt --- tasks/deb_CLI_packages.yml | 37 ++++++++++++++++++------------------- tasks/deb_docker.yml | 16 +++++++--------- 2 files changed, 25 insertions(+), 28 deletions(-) diff --git a/tasks/deb_CLI_packages.yml b/tasks/deb_CLI_packages.yml index 49051cb..c8fb2f0 100644 --- a/tasks/deb_CLI_packages.yml +++ b/tasks/deb_CLI_packages.yml @@ -6,26 +6,25 @@ - name: Install base CLI packages apt: - name: "{{ item }}" + name: + - sudo + - wget + - curl + - zsh + - vim + - tmux + - ruby + - git + - tig + - openssh-server + - sshfs + - htop + - iftop + - iotop + - glances + - ranger + - rxvt-unicode-256color state: present - with_items: - - sudo - - wget - - curl - - zsh - - vim - - tmux - - ruby - - git - - tig - - openssh-server - - sshfs - - htop - - iftop - - iotop - - glances - - ranger - - rxvt-unicode-256color - name: Install extra CLI packages apt: diff --git a/tasks/deb_docker.yml b/tasks/deb_docker.yml index a827575..1a3f92b 100644 --- a/tasks/deb_docker.yml +++ b/tasks/deb_docker.yml @@ -1,20 +1,18 @@ --- - name: Remove depot docker version apt: - name: "{{ item }}" + name: + - docker + - docker-engine + - docker.io state: absent - with_items: - - docker - - docker-engine - - docker.io - name: Install tool to use apt with https apt: - name: "{{ item }}" + name: + - apt-transport-https + - ca-certificates state: present - with_items: - - apt-transport-https - - ca-certificates - name: Add Docker apt key. apt_key: From 17a1f6080492f51559304311ea4b103285d81284 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Mon, 24 Feb 2020 07:06:47 +0100 Subject: [PATCH 5/7] Fix: change uid for waha --- vars/BV_boutique.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/BV_boutique.yml b/vars/BV_boutique.yml index d5ec5ec..25a9b85 100644 --- a/vars/BV_boutique.yml +++ b/vars/BV_boutique.yml @@ -4,6 +4,6 @@ deploy_public_key: id_rsa_manioc.pub deploy_users: - username: 'waha' password: '$6$tQLlZ3lI/NDcT3.C$VCBzrpNxDgOK7b2que2/BnAYWl.zKVugZrQEPxtsq3iWcskEzQ1NvytZRXkB4GCDa/xEohxiodyCaZyFnhxby1' - uid: '999' + uid: '1001' group: wheel groups: sudo From b6dbb991401a338803d54ae8915a806c90a3bdf1 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Mon, 24 Feb 2020 07:51:16 +0100 Subject: [PATCH 6/7] Feat: add BV_boutique in sshconfig --- files/dotfiles/sshconfig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/files/dotfiles/sshconfig b/files/dotfiles/sshconfig index 1e89cf9..a2286d1 100755 --- a/files/dotfiles/sshconfig +++ b/files/dotfiles/sshconfig @@ -14,6 +14,16 @@ Host Embrevade identityfile ~/.ssh/id_ed25519_embrevade IdentitiesOnly yes +Host BV_boutique + HostName vps789921.ovh.net + User waha + Port 22 + ForwardAgent yes + PubkeyAcceptedKeyTypes * + identityfile ~/.ssh/id_rsa_manioc + IdentitiesOnly yes + + Host git_opytex HostName git.opytex.org User git From b4f53e651019161205de345be170cb22069ae0e7 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Mon, 24 Feb 2020 07:52:25 +0100 Subject: [PATCH 7/7] Feat: add gpg --- tasks/deb_docker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/deb_docker.yml b/tasks/deb_docker.yml index 1a3f92b..7a6c407 100644 --- a/tasks/deb_docker.yml +++ b/tasks/deb_docker.yml @@ -7,11 +7,12 @@ - docker.io state: absent -- name: Install tool to use apt with https +- name: Install tool to use apt with https and gpg apt: name: - apt-transport-https - ca-certificates + - gpg state: present - name: Add Docker apt key.