cleanup and descritive README
This commit is contained in:
parent
ed40c478e9
commit
44e8e027e4
24 changed files with 1605 additions and 2 deletions
48
ansible/roles/mount_object_storage/tasks/main.yml
Executable file
48
ansible/roles/mount_object_storage/tasks/main.yml
Executable file
|
|
@ -0,0 +1,48 @@
|
|||
---
|
||||
- name: Ensure mount point"
|
||||
ansible.builtin.stat:
|
||||
path: "{{ item.split(' ')[1] }}"
|
||||
with_items: "{{ fstab }}"
|
||||
|
||||
- name: "Create mount point"
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.split(' ')[1] }}"
|
||||
state: directory
|
||||
mode: '0777'
|
||||
with_items: "{{ fstab }}"
|
||||
|
||||
- name: Create passwd-s3fs file
|
||||
ansible.builtin.file:
|
||||
path: "/etc/passwd-s3fs"
|
||||
state: touch
|
||||
mode: '0600'
|
||||
|
||||
- name: Write s3fs mount options to fstab
|
||||
ansible.builtin.lineinfile:
|
||||
path: "/etc/fstab"
|
||||
line: "{{ item }}"
|
||||
with_items:
|
||||
- "{{ fstab }}"
|
||||
|
||||
- name: Remove line from fstab
|
||||
ansible.builtin.lineinfile:
|
||||
path: "/etc/fstab"
|
||||
regexp: ".*rw,.*"
|
||||
state: absent
|
||||
|
||||
- name: Write s3fs password to passwd-s3fs
|
||||
ansible.builtin.lineinfile:
|
||||
path: "/etc/passwd-s3fs"
|
||||
line: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
- "{{ passwd_s3fs }}"
|
||||
|
||||
- name: Mount s3-bucket
|
||||
ansible.posix.mount:
|
||||
path: "{{ item.split(' ')[1] }}"
|
||||
src: "{{ item.split(' ')[0] }}"
|
||||
opts: "{{ item.split(' ')[3] }}"
|
||||
fstype: "{{ item.split(' ')[2] }}"
|
||||
state: mounted
|
||||
with_items: "{{ fstab }}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue