Skip to content
Snippets Groups Projects
Commit bf09d7cf authored by jurgenhaas's avatar jurgenhaas
Browse files

New script to fully update JailKits and also set ownership in home directories...

New script to fully update JailKits and also set ownership in home directories globally and inside jails
parent 838917c4
No related branches found
No related tags found
No related merge requests found
......@@ -11,10 +11,22 @@
when: php_version|default('5.5') == '7'
tags: always
- name: "Reset Permissions in User Homes"
file:
path: '/home/{{ item }}'
state: 'directory'
owner: '{{ item }}'
group: 'root'
recurse: yes
with_flattened:
- '{{ admins }}'
- '{{ jailusers }}'
- name: "Check JailKit Requirement"
shell: ls /usr/sbin/jk_init
register: jailkit_available
failed_when: false
changed_when: false
- include: install.yml
when: jailkit_available is defined and jailkit_available.stdout != '/usr/sbin/jk_init'
......@@ -154,9 +166,11 @@
mode='644'
- name: "Update Jails"
shell: jk_update -j {{ jailroot }}/{{ item.jail.name }} --skip=/etc/drush/aliases.drushrc.php /bin /dev /etc /home /lib /lib64 /opt /usr
include: updatejail.yml
with_items: '{{ drupal_settings|default([]) }}'
when: item.jail is defined and (limit_drupal_site is not defined or item.id is not defined or limit_drupal_site == item.id)
loop_control:
loop_var: drupal
when: drupal.jail is defined and (limit_drupal_site is not defined or drupal.id is not defined or limit_drupal_site == drupal.id)
tags:
- 'UpdateJails'
- 'shells'
---
# file: roles/jailkit/tasks/updatejail.yml
- name: "JailKit Update Directories"
shell: jk_update -j {{ jailroot }}/{{ drupal.jail.name }} --skip=/etc/drush/aliases.drushrc.php /bin /dev /etc /home /lib /lib64 /opt /usr
- name: "Reset Permissions in User Homes"
file:
path: '{{ jailroot }}/{{ drupal.jail.name }}/home/{{ item }}'
state: 'directory'
owner: '{{ item }}'
group: 'root'
recurse: yes
with_flattened:
- '{{ admins }}'
- '{{ jailusers }}'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment