Skip to content
Snippets Groups Projects
Commit 9c55443f authored by shirenn's avatar shirenn 🌊
Browse files

Merge branch 'nettoyage-de-printemps' into 'newinfra'

Nettoyage de printemps

See merge request !197
parents d7b90694 b064590f
No related branches found
No related tags found
1 merge request!197Nettoyage de printemps
---
- name: Install ansible
apt:
update_cache: true
name:
- ansible
register: apt_result
retries: 3
until: apt_result is succeeded
- name: Create ansible directory
file:
path: /var/local/ansible
state: directory
mode: '2775'
owner: root
group: nounou
- name: Set ACL for ansible directory
acl:
path: /var/local/ansible
default: true
entity: nounou
etype: group
permissions: rwx
state: query
- name: Clone Ansible project
git:
repo: 'http://gitlab.adm.crans.org/nounous/ansible.git'
dest: /var/local/ansible
umask: '002'
version: 'master'
- name: Indicate Ansible in motd
template:
src: update-motd.d/05-service.j2
dest: /etc/update-motd.d/05-ansible
mode: 0755
- name: Enable automatic removal of stale sockets
lineinfile:
dest: /etc/ssh/sshd_config
regexp: ^StreamLocalBindUnlink
line: "StreamLocalBindUnlink yes # Enable automatic removal of stale sockets"
state: absent
- name: Restart sshd
systemd:
enabled: true
state: restarted
name: sshd
#!/usr/bin/tail +14
{{ ansible_header | comment }}
> Ansible a été déployé sur cette machine. Voir /var/local/ansible/.
---
- name: Install backuppc
apt:
update_cache: true
name: backuppc
register: apt_result
retries: 3
until: apt_result is succeeded
- name: Disable mlocate indexation of backup files
lineinfile:
path: /etc/updatedb.conf
regexp: '^PRUNEPATHS'
line: PRUNEPATHS="/tmp /var/spool /media /var/lib/os-prober /var/lib/ceph /var/lib/backuppc /backup"
- name: Indicate role in motd
template:
src: update-motd.d/05-service.j2
dest: /etc/update-motd.d/05-backuppc
mode: 0755
#!/usr/bin/tail +14
{{ ansible_header | comment }}
> BackupPC a été déployé sur cette machine. Voir /etc/backuppc/ et /var/lib/backuppc/.
---
- name: Deploy /home systemd mounts
template:
src: "systemd/system/home.mount.j2"
dest: "/etc/systemd/system/home\x2dadh-{{ item }}.mount"
mode: 0644
loop:
- a
- b
- c
- d
- e
- f
- g
- h
- i
- j
- k
- l
- m
- n
- o
- p
- q
- r
- s
- t
- u
- v
- w
- x
- y
- z
- mail
- logs
- name: Load and activate /home systemd mounts
systemd:
name: "home\x2dadh-{{ item }}.mount"
daemon_reload: true
enabled: true
state: started
loop:
- a
- b
- c
- d
- e
- f
- g
- h
- i
- j
- k
- l
- m
- n
- o
- p
- q
- r
- s
- t
- u
- v
- w
- x
- y
- z
- mail
- logs
{{ ansible_header | comment }}
[Unit]
Description=Mount /home-adh/{{ item }}
After=iscsi.service iscsid.service lvm2-activation-early.service multipathd.service
[Mount]
What=/dev/mapper/mpath-home-{{ item }}-part1
Where=/home-adh/{{ item }}
Type=ext4
Options=rw,usrjquota=aquota.user,jqfmt=vfsv1,nosuid,nodev,nofail
[Install]
WantedBy=multi-user.target
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment