Merge branch 'master' of ssh://git_opytex/lafrite/Ansible_workstation

This commit is contained in:
Bertrand Benjamin 2018-11-07 15:28:16 +01:00
commit 9d333aa1a0
7 changed files with 47 additions and 12 deletions

View File

@ -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

View File

@ -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:

View File

@ -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:
@ -16,7 +20,10 @@
dest: ~/.ansible/plugins/modules/aur
version: master
accept_hostkey: yes
become: yes
become_user: aur_builder
tags:
- first_deployement
- name: Install Yay
aur:

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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