configpolicy/roles/websites/chmod777.sh/tasks/main.yml

54 lines
1.2 KiB
YAML

- name: ensure rsync is installed
package:
name: rsync
state: present
tags:
- install
- name: ensure app group exists
group:
name: webapp.chmod777
state: present
- name: ensure app user exists
user:
name: webapp.chmod777
group: webapp.chmod777
home: /srv/www/chmod777.sh
createhome: yes
state: present
- name: ensure app home directory permissions are set
file:
path: /srv/www/chmod777.sh
mode: '0755'
state: directory
- name: ensure app ssh home directory exists
file:
path: /srv/www/chmod777.sh/.ssh
mode: '0700'
owner: webapp.chmod777
group: webapp.chmod777
setype: ssh_home_t
- name: ensure publisher keys are trusted
authorized_key:
key: "{{ chmod777_publisher_keys|join('\n') }}"
user: webapp.chmod777
exclusive: true
- name: ensure authorized keys file permissions are correct
file:
path: /srv/www/chmod777.sh/.ssh/authorized_keys
mode: '0600'
owner: webapp.chmod777
group: webapp.chmod777
setype: ssh_home_t
- name: ensure apache is configured to serve chmod777.sh
copy:
src: chmod777.sh.httpd.conf
dest: /etc/httpd/conf.d/chmod777.sh.conf
mode: '0644'
notify: reload httpd
tags:
- httpd-config