59 lines
1.6 KiB
YAML
Raw Normal View History

---
# Mount shares that all systems should have.
2021-02-02 21:28:17 -06:00
- name: General | Account Management | Mounts | Create 1337 Folder
2021-02-01 08:17:50 -06:00
file:
path: "{{ leet_drive }}"
2021-02-01 08:17:50 -06:00
state: directory
mode: '0755'
2021-02-06 07:00:47 -06:00
# Linux uses fstab
- name: General | Account Management | Mounts | Create 1337 fstab Entry
2021-02-06 07:00:47 -06:00
blockinfile:
path: /etc/fstab
2021-02-06 07:00:47 -06:00
block: |
ling@leet: /mnt/leet fuse.sshfs defaults,_netdev,allow_other,delay_connect 0 0
marker: '# {mark} MANAGED BY ANSIBLE | Leet Share'
state: present
backup: yes
when: ansible_system == "Linux"
2021-02-06 07:00:47 -06:00
#TODO Remove this
- name: General | Account Management | Mounts | Create 1337 fstab Comment
lineinfile:
path: /etc/fstab
regexp: '^# MANAGED BY ANSIBLE | Leet Share'
line: '# MANAGED BY ANSIBLE | Leet Share'
2021-02-06 07:00:47 -06:00
state: absent
insertbefore: '^ling@leet'
when: ansible_system == "Linux"
2021-02-06 07:00:47 -06:00
#TODO Remove this
- name: General | Account Management | Mounts | Create 1337 fstab Entry
lineinfile:
path: /etc/fstab
regexp: '^ling@leet'
line: "ling@leet: /mnt/leet fuse.sshfs defaults,_netdev,allow_other,delay_connect 0 0"
state: absent
backup: yes
when: ansible_system == "Linux"
- name: General | Account Management | Mounts | Mount All (Linux)
shell: mount -a
2021-02-02 21:12:44 -06:00
args:
2021-02-02 21:10:56 -06:00
warn: false
when: ansible_system == "Linux"
2021-02-03 12:50:29 -06:00
2021-02-06 07:00:47 -06:00
# FreeBSD has to do this via root cron job, fstab is unhappy
- name: General | Account Management | Mounts | Unmount 1337 (FreeBSD)
2021-02-06 07:00:47 -06:00
shell: umount -f /mnt/leet
args:
warn: false
when: ansible_system == "FreeBSD"
ignore_errors: yes
- name: General | Account Management | Mounts | Remount 1337 (FreeBSD)
2021-02-06 07:00:47 -06:00
shell: "{{ sshfs_leet_cmd }}"
when: ansible_system == "FreeBSD"