feat: initial commit
This commit is contained in:
parent
e4243a7952
commit
cf9fbd2283
13 changed files with 150 additions and 93 deletions
23
tasks/config.yaml
Normal file
23
tasks/config.yaml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
|
||||
# create directories
|
||||
- name: "config - create directory"
|
||||
ansible.builtin.file:
|
||||
path: "{{ __shares['path'] }}"
|
||||
state: "directory"
|
||||
owner: "{{ __shares['owner'] | default('root') }}"
|
||||
group: "{{ __shares['group'] | default('root') }}"
|
||||
mode: "{{ __shares['mode'] | default('0770') }}"
|
||||
loop: "{{ shares }}"
|
||||
loop_control:
|
||||
loop_var: "__shares"
|
||||
|
||||
# configure exports file
|
||||
- name: "config - exports file"
|
||||
ansible.builtin.template:
|
||||
src: "templates/exports.j2"
|
||||
dest: "/etc/exports"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
notify: "exportfs"
|
||||
16
tasks/install.yaml
Normal file
16
tasks/install.yaml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
|
||||
# install nfs_server
|
||||
- name: "installation - nfsd"
|
||||
ansible.builtin.apt:
|
||||
name: "nfs-kernel-server"
|
||||
state: "latest"
|
||||
cache_valid_time: "120"
|
||||
when: 'ansible_os_family == "Debian"'
|
||||
|
||||
# start nfs service
|
||||
- name: "service start nfs-server"
|
||||
ansible.builtin.systemd:
|
||||
name: "nfs-server"
|
||||
state: "started"
|
||||
enabled: true
|
||||
9
tasks/main.yaml
Normal file
9
tasks/main.yaml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
|
||||
# install nfs-server
|
||||
- name: "install"
|
||||
ansible.builtin.import_tasks: "install.yaml"
|
||||
|
||||
# configure nfs-server
|
||||
- name: "config"
|
||||
ansible.builtin.import_tasks: "config.yaml"
|
||||
Loading…
Add table
Add a link
Reference in a new issue