Reorganization including fixing blockinfile being used multiple times on the same file causing entries to get overwritten.

This commit is contained in:
2021-02-03 07:36:51 -06:00
parent 51766c8db6
commit 1a4a176933
7 changed files with 82 additions and 51 deletions

View File

@ -7,13 +7,22 @@
state: directory
mode: '0755'
- name: General | Account Management | Mounts | Create fstab Entries
blockinfile:
- name: General | Account Management | Mounts | Create 1337 fstab Entry
lineinfile:
path: /etc/fstab
block: |
ling@leet: /mnt/leet fuse.sshfs defaults,_netdev,allow_other,delay_connect 0 0
regexp: '^ling@leet'
line: "ling@leet: /mnt/leet fuse.sshfs defaults,_netdev,allow_other,delay_connect 0 0"
state: present
backup: yes
- 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'
state: present
insertbefore: '^ling@leet'
- name: General | Account Management | Mounts | Mount All
shell: mount -a
args:

View File

@ -1,15 +0,0 @@
---
- name: General | Software | Harden | Remove CUPS Daemon
service:
name: "{{ cups }}"
pattern: "{{ cups_pattern }}"
state: stopped
enabled: no
- name: General | Software | Harden | Remove CUPS-Browse Daemon
service:
name: "{{ cups_browse }}"
pattern: "{{ cups_browse_pattern }}"
state: stopped
enabled: no

View File

@ -0,0 +1,40 @@
---
# Enable and disable services.
- name: General | Software | Services | Create SSHFS rc.conf Entry (FreeBSD)
lineinfile:
path: /etc/rc.conf
regexp: '^fusefs_enable='
line: fusefs_enable="YES"
state: present
backup: yes
when: ansible_system == "FreeBSD"
- name: General | Software | Services | Create SSHFS rc.conf Comment (FreeBSD)
lineinfile:
path: /etc/fstab
regexp: '^# MANAGED BY ANSIBLE | SSHFS'
line: '# MANAGED BY ANSIBLE | SSHFS'
state: present
insertbefore: '^fusefs_enable='
when: ansible_system == "FreeBSD"
- name: General | Software | Services | Load SSHFS (FreeBSD)
shell: kldload fusefs
args:
warn: false
when: ansible_system == "FreeBSD"
- name: General | Software | Services | Disable CUPS Daemon
service:
name: "{{ cups }}"
pattern: "{{ cups_pattern }}"
state: stopped
enabled: no
- name: General | Software | Services | Disable CUPS-Browse Daemon
service:
name: "{{ cups_browse }}"
pattern: "{{ cups_browse_pattern }}"
state: stopped
enabled: no