Feat(Songe): Create Songe

This commit is contained in:
Bertrand Benjamin 2018-10-04 16:38:39 +02:00
parent 122bf44f91
commit 2d921e1ec2
4 changed files with 112 additions and 0 deletions

View File

@ -14,6 +14,10 @@ Installing Choux
ansible-pull -U https://git.opytex.org/lafrite/Ansible_workstation.git Choux.yml
Installing Songe
ansible-pull -U https://git.opytex.org/lafrite/Ansible_workstation.git Songe.yml
Installing Bilimbi
ansible-pull -U https://git.opytex.org/lafrite/Ansible_workstation.git Bilimbi.yml

26
Songe.yml Normal file
View File

@ -0,0 +1,26 @@
---
- hosts: localhost
connection: local
vars_files:
- vars/common.yml
- vars/Songe.yml
tasks:
- include: tasks/deb_CLI_packages.yml
- include: tasks/zsh.yml
- include: tasks/users.yml
- include: tasks/sudo.yml
- include: tasks/ssh.yml
- include: tasks/dotfiles.yml
- include: tasks/docker.yml
handlers:
- name: restart sshd
service:
name: sshd
state: restarted
- name: restart nfs
service:
name: nfs-kernel-server
state: restarted

61
tasks/NAS_mounts.yml Normal file
View File

@ -0,0 +1,61 @@
---
- name: create mount points
file:
path: "{{ item.name }}"
state: directory
with_items: "{{ label_mounts }}"
- name: Mount data drives for storage
mount:
name: '{{ item.name }}'
src: '{{ item.label }}'
fstype: ext4
passno: 2
state: mounted
with_items: "{{ label_mounts }}"
- name: create mount points
file:
path: "{{ item.name }}"
state: directory
with_items: "{{ access_mounts }}"
- name: Mount media mounts for easy access
mount:
name: '{{ item.name }}'
src: '{{ item.src }}'
fstype: none
opts: bind
passno: 0
state: mounted
with_items: "{{ access_mounts }}"
- name: install nfs
apt:
pkg: nfs-kernel-server
state: present
notify: restart nfs
- name: Lines in exports
lineinfile:
dest: /etc/exports
line: "{{ item.name }} 192.168.1.1/24({{ item.options }})"
with_items: "{{ nfs_shares }}"
notify: restart nfs
- name: create mount points
file:
path: "{{ item.name }}"
state: directory
with_items: "{{ nfs_shares }}"
- name: rbind Mounts for NFS etc.
mount:
name: '{{ item.name }}'
src: '{{ item.src }}'
fstype: none
opts: rbind
passno: 0
state: mounted
with_items: "{{ nfs_shares }}"
notify: restart nfs

21
vars/Songe.yml Normal file
View File

@ -0,0 +1,21 @@
---
me: "{{ deploy_users }}"
deploy_public_key: files/id_ed25519_home.pub
minimal: true
server: true
label_mounts:
- { label: 'LABEL=Tosh500G', name: '/mnt/Tosh500G' }
- { label: 'LABEL=BackupWD_1T', name: '/mnt/BackupWD_1T' }
- { label: 'LABEL=AptCacherNG', name: '/var/cache/apt-cacher-ng/' }
- { label: 'LABEL=Backup', name: '/mnt/Backup' }
access_mounts:
- { src: '/mnt/Tosh500G', name: '/media/documents' }
- { src: '/mnt/BackupWD_1T', name: '/media/backup' }
nfs_shares:
- { src: '/media/documents', name: '/export/documents', options: 'rw,no_subtree_check,nohide' }
- { src: '/media/backup', name: '/export/backup', options: 'rw,no_subtree_check,nohide' }
- { src: '/media/documents/musique', name: '/export/musique', options: 'ro,no_subtree_check,nohide' }