Skip to content

Commit

Permalink
migrate pgsql installation from rpm to container-based
Browse files Browse the repository at this point in the history
  • Loading branch information
archanaserver committed Nov 27, 2024
1 parent 75c9a34 commit 253ab92
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
34 changes: 33 additions & 1 deletion playbooks/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,41 @@
- { type: host, database: all, user: postgres, address: '0.0.0.0/0', auth_method: reject }
- { type: host, database: all, user: all, address: '127.0.0.1/32', auth_method: md5 }
- { type: host, database: all, user: all, address: '::1/128', auth_method: md5 }
pre_tasks:
- name: Pull PostgreSQL container image
containers.podman.podman_image:
name: registry.access.redhat.io/rhel9/postgresql-16:latest
state: present

- name: Create directory for PostgreSQL data
ansible.builtin.file:
path: /data/postgresql
state: directory
owner: 26
group: 26
mode: '0755'

- name: Run PostgreSQL container
containers.podman.podman_container:
name: postgresql
image: registry.access.redhat.io/rhel9/postgresql-16:latest
state: started
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: "CHANGEME"
POSTGRESQL_DATABASE: foreman
volumes:
- /data/postgresql:/var/lib/pgsql/data:Z
ports:
- "5432:5432"

- name: Wait for PostgreSQL to be ready
wait_for:

Check failure on line 82 in playbooks/deploy.yaml

View workflow job for this annotation

GitHub Actions / Ansible Lint

fqcn[action-core]

Use FQCN for builtin module actions (wait_for).
host: localhost
port: 5432
timeout: 30
roles:
- certificates
- geerlingguy.postgresql
- redis
- candlepin
- httpd
Expand Down
3 changes: 0 additions & 3 deletions playbooks/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@
baseurl: https://yum.theforeman.org/pulpcore/nightly/el9/x86_64/
gpgcheck: false

- name: Install postgresql-evr
ansible.builtin.package:
name: postgresql-evr

0 comments on commit 253ab92

Please sign in to comment.