Skip to content

Commit

Permalink
use lineinfile loop instead of blockinfile
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosch86 committed May 5, 2024
1 parent c3e2785 commit e9c9175
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,18 @@
path: "{{ pbs_service_dir }}/etc/datastore.cfg"
register: datastore_cfg

- name: Ensure acl.cfg config
ansible.builtin.blockinfile:
marker_begin: "### ANSIBLE MANAGED BLOCK DEFAULT ACL BEGIN"
marker_end: "### ANSIBLE MANAGED BLOCK DEFAULT ACL END"
block: |
acl:1:/:admin@pbs:Admin
acl:1:/:backup@pbs,sync@pbs:DatastorePowerUser
acl:1:/:monitoring@pbs,monitoring@pbs!zabbix:Audit
- name: Ensure acl.cfg
ansible.builtin.lineinfile:
path: "{{ pbs_service_dir }}/etc/acl.cfg"
line: "{{ item }}"
owner: backup
group: backup
mode: "0640"
create: true
loop:
- "acl:1:/:admin@pbs:Admin"
- "acl:1:/:backup@pbs,sync@pbs:DatastorePowerUser"
- "acl:1:/:monitoring@pbs,monitoring@pbs!zabbix:Audit"

- name: Check if user.cfg exists
ansible.builtin.stat:
Expand Down

0 comments on commit e9c9175

Please sign in to comment.