Skip to content

Commit

Permalink
https://github.com/ansible/ansible-lint/pull/2527
Browse files Browse the repository at this point in the history
  • Loading branch information
hswong3i committed Oct 2, 2022
1 parent 4c3b0d6 commit b884803
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 45 deletions.
53 changes: 29 additions & 24 deletions playbooks/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,53 +22,58 @@
ignore_unreachable: true
tasks:
- name: rm -rf /var/cache/ansible/*
ansible.builtin.raw: |
set -eu
rm -rf /var/cache/ansible/*
rm -rf /root/.cache/*
rm -rf /tmp/*
ansible.builtin.raw:
cmd: |
set -eu
rm -rf /var/cache/ansible/*
rm -rf /root/.cache/*
rm -rf /tmp/*
args:
executable: "/bin/bash"
changed_when: false
failed_when: false

- name: debian | apt-get -y clean
ansible.builtin.raw: |
set -eu
apt-get -y autoremove
apt-get -y autoclean
apt-get -y clean
rm -rf /var/lib/apt/lists/*
ansible.builtin.raw:
cmd: |
set -eu
apt-get -y autoremove
apt-get -y autoclean
apt-get -y clean
rm -rf /var/lib/apt/lists/*
args:
executable: "/bin/bash"
changed_when: false
failed_when: false

- name: redhat | yum clean all
ansible.builtin.raw: |
set -eu
yum clean all
rm -rf /var/cache/yum/*
ansible.builtin.raw:
cmd: |
set -eu
yum clean all
rm -rf /var/cache/yum/*
args:
executable: "/bin/bash"
changed_when: false
failed_when: false

- name: suse | zypper clean --all
ansible.builtin.raw: |
set -eu
zypper clean --all
rm -rf /var/cache/zypper/*
ansible.builtin.raw:
cmd: |
set -eu
zypper clean --all
rm -rf /var/cache/zypper/*
args:
executable: "/bin/bash"
changed_when: false
failed_when: false

- name: redhat | subscription-manager unregister
ansible.builtin.raw: |
set -eu
subscription-manager remove --all
subscription-manager unregister
subscription-manager clean
ansible.builtin.raw:
cmd: |
set -eu
subscription-manager remove --all
subscription-manager unregister
subscription-manager clean
changed_when: false
failed_when: false
31 changes: 17 additions & 14 deletions playbooks/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,24 @@
failed_when: false

- name: purge /var/lib/postgresql/data
ansible.builtin.shell: |
set -euxo pipefail
mkdir -p /var/lib/postgresql/data
find /var/lib/postgresql/data -mindepth 1 -delete
ansible.builtin.shell:
cmd: |
set -euxo pipefail
mkdir -p /var/lib/postgresql/data
find /var/lib/postgresql/data -mindepth 1 -delete
args:
executable: "/bin/bash"
register: result
changed_when: result is not succeeded

- name: re-create /var/run/postgresql
ansible.builtin.shell: |
set -euxo pipefail
rm -rf /var/run/postgresql
mkdir -p /var/run/postgresql
chown -Rf postgres:postgres /var/run/postgresql
chmod 2777 /var/run/postgresql
ansible.builtin.shell:
cmd: |
set -euxo pipefail
rm -rf /var/run/postgresql
mkdir -p /var/run/postgresql
chown -Rf postgres:postgres /var/run/postgresql
chmod 2777 /var/run/postgresql
args:
executable: "/bin/bash"
register: result
Expand All @@ -134,10 +136,11 @@
- { dest: "/var/run/postgresql", owner: "postgres", group: "postgres", mode: "2777" }

- name: "prepare /usr/share/postgresql/postgresql.conf.sample"
ansible.builtin.shell: |
set -euxo pipefail
mv /usr/share/postgresql/{{ postgres_release }}/postgresql.conf.sample /usr/share/postgresql/
ln -s ../postgresql.conf.sample /usr/share/postgresql/{{ postgres_release }}/postgresql.conf.sample
ansible.builtin.shell:
cmd: |
set -euxo pipefail
mv /usr/share/postgresql/{{ postgres_release }}/postgresql.conf.sample /usr/share/postgresql/
ln -s ../postgresql.conf.sample /usr/share/postgresql/{{ postgres_release }}/postgresql.conf.sample
args:
executable: "/bin/bash"
creates: "/usr/share/postgresql/postgresql.conf.sample"
Expand Down
2 changes: 1 addition & 1 deletion roles/ansible
2 changes: 1 addition & 1 deletion roles/catatonit
2 changes: 1 addition & 1 deletion roles/gosu
2 changes: 1 addition & 1 deletion roles/locales
2 changes: 1 addition & 1 deletion roles/postgres
2 changes: 1 addition & 1 deletion roles/python
2 changes: 1 addition & 1 deletion roles/timezone

0 comments on commit b884803

Please sign in to comment.