Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions ansible/roles/pgo-operator/tasks/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@
no_log: false
tags: deprovision

- name: Delete Custom Resource Definitions
shell: |
{{ kubectl_or_oc }} delete crds pgbackups.crunchydata.com pgclusters.crunchydata.com \
pgpolicies.crunchydata.com pgreplicas.crunchydata.com pgtasks.crunchydata.com
ignore_errors: yes
no_log: false
tags: deprovision

- name: Check for output directory
stat:
path: "{{ output_dir }}"
Expand All @@ -177,3 +185,14 @@
state: directory
mode: 0700
tags: always

- name: Delete PGO client
become: yes
become_method: sudo
file:
state: absent
path: "/usr/local/bin/pgo"
when: pgo_client_install == "true"
ignore_errors: yes
no_log: false
tags: deprovision
1 change: 1 addition & 0 deletions ansible/roles/pgo-operator/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
url: "{{ pgo_client_url }}/pgo"
dest: "/usr/local/bin/pgo"
mode: 0755
force: yes
when: uname_result.stdout == "Linux" and pgo_client_install == "true"
tags: [install, update]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ With the correct playbooks acquired and prerequisites satisfied, simply run
the following command:

```bash
ansible-playbook -i /path/to/inventory --tags=deprovision main.yml
ansible-playbook -i /path/to/inventory --tags=deprovision --ask-become-pass main.yml
```

If the Crunchy PostgreSQL Operator playbooks were installed using `yum`, use the
Expand All @@ -26,13 +26,15 @@ following commands:
```bash
export ANSIBLE_ROLES_PATH=/usr/share/ansible/roles/crunchydata

ansible-playbook -i /path/to/inventory --tags=deprovision \
ansible-playbook -i /path/to/inventory --tags=deprovision --ask-become-pass \
/usr/share/ansible/postgres-operator/playbooks/main.yml
```

## Deleting `pgo` Client

To remove the `pgo` client, simply run the following command:
If variable `pgo_client_install` is set to `true` in the `inventory` file, the `pgo` client will also be uninstalled when deprovisioning.

Otherwise, the `pgo` client can be manually uninstalled by running the following command:

```
rm /usr/local/bin/pgo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ of the service. Using the `update` flag will:
* Recreate configuration maps used by operator
* Remove any deprecated objects
* Allow administrators to change settings configured in the `inventory`
* Reinstall the `pgo` client if a new version is specified

The following assumes the proper [prerequisites are satisfied](/installation/install-with-ansible/prereq/prerequisites/)
we can now update the PostgreSQL Operator.
Expand Down