Feat(choux): add first_deployement tag

This commit is contained in:
Bertrand Benjamin 2018-11-07 10:57:55 +01:00
parent 95205bcd78
commit 40f7f91e72
7 changed files with 45 additions and 13 deletions

View File

@ -14,7 +14,7 @@
- include: tasks/sudo.yml - include: tasks/sudo.yml
- include: tasks/ssh.yml - include: tasks/ssh.yml
- include: tasks/arch_python.yml - include: tasks/arch_python.yml
# - include: tasks/arch_aur.yml - include: tasks/arch_aur.yml
- include: tasks/arch_gnome.yml - include: tasks/arch_gnome.yml
- include: tasks/arch_graphicals.yml - include: tasks/arch_graphicals.yml
- include: tasks/dotfiles.yml - include: tasks/dotfiles.yml

View File

@ -3,6 +3,8 @@
pacman: pacman:
update_cache: yes update_cache: yes
upgrade: yes upgrade: yes
tags:
- first_deployement
- name: Install base CLI packages - name: Install base CLI packages
pacman: pacman:
@ -30,6 +32,8 @@
- autofs - autofs
- bind-tools - bind-tools
state: present state: present
tags:
- first_deployement
- name: Install extra CLI packages - name: Install extra CLI packages
pacman: pacman:

View File

@ -2,6 +2,8 @@
- user: - user:
name: aur_builder name: aur_builder
group: wheel group: wheel
tags:
- first_deployement
- lineinfile: - lineinfile:
path: /etc/sudoers.d/11-install-aur_builder path: /etc/sudoers.d/11-install-aur_builder
@ -9,6 +11,8 @@
line: 'aur_builder ALL=(ALL) NOPASSWD: /usr/bin/pacman' line: 'aur_builder ALL=(ALL) NOPASSWD: /usr/bin/pacman'
create: yes create: yes
validate: 'visudo -cf %s' validate: 'visudo -cf %s'
tags:
- first_deployement
- name: Git clone ansible-aur - name: Git clone ansible-aur
git: git:
@ -18,6 +22,8 @@
accept_hostkey: yes accept_hostkey: yes
become: yes become: yes
become_user: aur_builder become_user: aur_builder
tags:
- first_deployement
- name: Install Yay - name: Install Yay
aur: aur:

View File

@ -10,6 +10,8 @@
regexp: "^#?PermitEmptyPasswords" regexp: "^#?PermitEmptyPasswords"
line: "PermitEmptyPasswords no" line: "PermitEmptyPasswords no"
backrefs: yes backrefs: yes
tags:
- first_deployement
- name: Disable remote root login - name: Disable remote root login
lineinfile: lineinfile:
@ -17,6 +19,8 @@
regexp: "^#?PermitRootLogin" regexp: "^#?PermitRootLogin"
line: "PermitRootLogin no" line: "PermitRootLogin no"
backrefs: yes backrefs: yes
tags:
- first_deployement
- name: Add public key for deploy user - name: Add public key for deploy user
authorized_key: authorized_key:
@ -25,6 +29,8 @@
state: present state: present
with_items: "{{ deploy_users }}" with_items: "{{ deploy_users }}"
register: add_identity_key register: add_identity_key
tags:
- first_deployement
- name: Disable password login - name: Disable password login
lineinfile: lineinfile:
@ -34,10 +40,14 @@
backrefs: yes backrefs: yes
when: add_identity_key is succeeded and not add_identity_key is skipped when: add_identity_key is succeeded and not add_identity_key is skipped
notify: restart sshd notify: restart sshd
tags:
- first_deployement
- name: Enable SSH daemon - name: Enable SSH daemon
service: service:
name: sshd name: sshd
state: started state: started
enabled: yes enabled: yes
tags:
- first_deployement

View File

@ -4,11 +4,15 @@
src: files/sudoers src: files/sudoers
dest: /etc/sudoers dest: /etc/sudoers
mode: 0440 mode: 0440
tags:
- first_deployement
- name: Create sudo group - name: Create sudo group
group: group:
name: sudo name: sudo
state: present state: present
tags:
- first_deployement
- name: Add deploy user to sudo group - name: Add deploy user to sudo group
user: user:
@ -16,3 +20,5 @@
groups: sudo groups: sudo
append: yes append: yes
with_items: '{{ deploy_users }}' with_items: '{{ deploy_users }}'
tags:
- first_deployement

View File

@ -6,6 +6,8 @@
uid: "{{ item.uid }}" uid: "{{ item.uid }}"
shell: /bin/zsh shell: /bin/zsh
with_items: "{{ deploy_users }}" with_items: "{{ deploy_users }}"
tags:
- first_deployement
- name: Add me - name: Add me
user: user:
@ -15,4 +17,6 @@
shell: /bin/zsh shell: /bin/zsh
with_items: "{{ me }}" with_items: "{{ me }}"
when: not minimal or not server when: not minimal or not server
tags:
- first_deployement

View File

@ -1,19 +1,21 @@
--- ---
- name: download default grml configuration # - name: download default grml configuration
get_url: # get_url:
url: http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc # url: http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc
dest: /etc/zsh/newuser.zshrc.recommended # dest: /etc/zsh/newuser.zshrc.recommended
backup: yes # backup: yes
#
- name: download default grml configuration # - name: download default grml configuration
get_url: # get_url:
url: http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc # url: http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc
dest: /etc/zsh/zshrc # dest: /etc/zsh/zshrc
force: yes # force: yes
backup: yes # backup: yes
- name: Set shell for root to zsh - name: Set shell for root to zsh
user: user:
name: root name: root
shell: /bin/zsh shell: /bin/zsh
tags:
- first_deployement