Skip to content

Commit a590bf7

Browse files
committed
Drop owner/group from /var/lib/openstack
These tasks run with "become: true", so the /var/lib/openstack dir should be root owned, just like the scripts created in the dir. Also correct the path to the tmpwatch script when it is set in the crontab, and in the molecule verify.yml. Signed-off-by: James Slagle <[email protected]>
1 parent 3aa0b70 commit a590bf7

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

roles/edpm_logrotate_crond/molecule/default/converge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
hosts: all
2020
gather_facts: false
2121
tasks:
22+
2223
- name: install edpm_logrotate_crond
2324
include_role:
2425
name: "osp.edpm.edpm_logrotate_crond"

roles/edpm_logrotate_crond/molecule/default/verify.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323

2424
- name: Push script
2525
ansible.builtin.stat:
26-
path: /usr/local/sbin/containers-tmpwatch
26+
path: /var/lib/openstack/cron/containers-tmpwatch
2727
register: stat_result
2828
failed_when: not stat_result.stat.exists
2929

3030
- name: Insert cronjob in root crontab
3131
ansible.builtin.shell:
3232
crontab -l
3333
register: crontab
34-
failed_when: "'@daily /usr/local/sbin/containers-tmpwatch' not in crontab.stdout"
34+
failed_when: "'@daily /var/lib/openstack/cron/containers-tmpwatch' not in crontab.stdout"
3535

3636
- name: Ensure config directories exist
3737
ansible.builtin.stat:

roles/edpm_logrotate_crond/tasks/configure.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
path: "/var/lib/openstack"
2323
mode: 0755
2424
state: directory
25-
owner: "{{ ansible_user }}"
26-
group: "{{ ansible_user }}"
2725
setype: "container_file_t"
2826

2927
- name: Create /var/lib/openstack/cron
@@ -52,7 +50,7 @@
5250
name: "Remove old logs"
5351
special_time: "daily"
5452
user: "root"
55-
job: "/usr/local/sbin/containers-tmpwatch"
53+
job: "/var/lib/openstack/cron/containers-tmpwatch"
5654

5755
- name: Configure logrotate_crond
5856
become: true

roles/edpm_logrotate_crond/tasks/install.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
- name: Gather local facts
1919
ansible.builtin.setup:
2020
gather_subset:
21+
- "!all"
22+
- "!min"
2123
- "local"
2224

2325
- name: Install cronie

0 commit comments

Comments
 (0)