Files
configpolicy/roles/websites/nratonpass.com/tasks/main.yml
Dustin C. Hatch f9e8c78e5a roles/websites: Set authorized_keys file perms
Because the various "webapp.*" users' home directories are under
`/srv/www`, the default SELinux context type is `httpd_sys_content_t`.
The SSH daemon is not allowed to read files with this label, so it
cannot load the contents of these users' `authorized_keys` files.  To
address this, we have to explicitly set the SELinux type to
`ssh_home_t`.
2020-12-30 20:59:27 -06:00

45 lines
1.0 KiB
YAML

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