Skip to content

Commit

Permalink
Set permissions for /opt/conf-meza and /opt/conf-meza/public
Browse files Browse the repository at this point in the history
Make these dirs suitable for meza-ansible to manage them without using
sudo.
  • Loading branch information
jamesmontalvo3 committed May 13, 2019
1 parent 6ecc855 commit 4d56386
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 13 deletions.
5 changes: 5 additions & 0 deletions config/core/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ m_backups_owner: root
m_backups_group: root


m_config_public_mode: "0755"
m_config_public_owner: meza-ansible
m_config_public_group: wheel


#
# PHP config
#
Expand Down
8 changes: 8 additions & 0 deletions src/playbooks/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@
group: wheel
mode: "0600"

- name: Ensure /opt/conf-meza owned by meza-ansible
file:
path: "/opt/conf-meza"
owner: meza-ansible
group: wheel
mode: "0755"


# FIXME 800: Run against localhost
- hosts: app-servers
become: yes
Expand Down
26 changes: 13 additions & 13 deletions src/roles/init-controller-config/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
file:
path: "{{ m_local_public }}"
state: directory
owner: root
group: root
mode: 0755
owner: "{{ m_config_public_owner }}"
group: "{{ m_config_public_group }}"
mode: "{{ m_config_public_mode }}"
recurse: true
delegate_to: localhost
run_once: true
Expand All @@ -71,20 +71,20 @@
file:
path: "{{ m_local_public }}/wikis"
state: directory
owner: root
group: root
mode: 0755
owner: "{{ m_config_public_owner }}"
group: "{{ m_config_public_group }}"
mode: "{{ m_config_public_mode }}"
delegate_to: localhost
run_once: true


- name: Ensure pre/post settings directories exists in config
file:
path: "/opt/conf-meza/public/{{ item }}"
path: "{{ m_local_public }}/{{ item }}"
state: directory
owner: root
group: root
mode: 0755
owner: "{{ m_config_public_owner }}"
group: "{{ m_config_public_group }}"
mode: "{{ m_config_public_mode }}"
delegate_to: localhost
run_once: true
with_items:
Expand All @@ -96,9 +96,9 @@
template:
src: "templates/{{ item }}.j2"
dest: "{{ m_local_public }}/{{ item }}"
owner: root
group: root
mode: 0755
owner: "{{ m_config_public_owner }}"
group: "{{ m_config_public_group }}"
mode: "{{ m_config_public_mode }}"
force: no
delegate_to: localhost
run_once: true
Expand Down
1 change: 1 addition & 0 deletions src/scripts/getmeza.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ if $ret; then
fi
fi

chown meza-ansible:wheel /opt/conf-meza

echo
echo "Add ansible master user"
Expand Down

0 comments on commit 4d56386

Please sign in to comment.