Skip to content

Commit 29521ca

Browse files
authored
Merge pull request #151 from ceph/update-ansible-plays
Update ansible for installation with py3.12 and Ubuntu Noble and postgresql 16
2 parents e0a3fdf + 0c4f66e commit 29521ca

File tree

16 files changed

+35
-339
lines changed

16 files changed

+35
-339
lines changed

deploy/playbooks/ansible.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[defaults]
22
retry_files_enabled = False
3+
stdout_callback=debug
34

45
[ssh_connection]
56
pipelining=True

deploy/playbooks/roles/common/handlers/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22

33
- name: reload systemd
4-
become: true
54
become: true
65
command: systemctl daemon-reload
76

deploy/playbooks/roles/common/tasks/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@
8080
notify:
8181
- restart app
8282

83-
- include: postgresql.yml
83+
- import_tasks: postgresql.yml
8484
tags:
8585
- postgres
8686

87-
- include: systemd.yml
87+
- import_tasks: systemd.yml
8888
tags:
8989
- systemd
9090

91-
- include: nginx.yml
91+
- import_tasks: nginx.yml
9292
tags:
9393
- nginx

deploy/playbooks/roles/common/tasks/nginx.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
notify:
3838
- restart nginx
3939

40-
- include: ssl.yml
40+
- import_tasks: ssl.yml
4141
when: development_server == true
4242

4343
- name: check to see if ssl cert needs created
@@ -46,7 +46,7 @@
4646
become: true
4747
register: ssl_cert
4848

49-
- include: letsencrypt.yml
49+
- import_tasks: letsencrypt.yml
5050
when: development_server == false and not ssl_cert.stat.exists
5151

5252
- name: link nginx config

deploy/playbooks/roles/common/tasks/postgresql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
become: true
77

88
- name: generate pseudo-random password for the postgres {{ app_name }} user
9-
local_action: shell python -c "exec 'import os; print os.urandom(30).encode(\'base64\')[:${length}]'" | tee {{ playbook_dir }}/tmp/app_user_password
9+
local_action: shell python3 -c "exec('import os,base64; print(base64.b64encode(os.urandom(30))[:${length}].decode())')" | tee {{ playbook_dir }}/tmp/app_user_password
1010
register: generated_app_user_password
1111
changed_when: false
1212
when: "'postgresql_master' in group_names"

deploy/playbooks/roles/common/templates/prod_db.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ sqlalchemy_w = {
99
}
1010

1111
sqlalchemy_ro = {
12-
'url': 'postgresql+psycopg2://{{ app_name }}:{{ postgresql_app_user_password }}@{{ standby_ip }}/{{ app_name }}',
12+
'url': 'postgresql+psycopg2://{{ app_name }}:{{ postgresql_app_user_password }}@{{ master_ip }}/{{ app_name }}',
1313
'echo': False,
1414
'echo_pool': False,
1515
'pool_recycle': 3600,

deploy/playbooks/roles/common/vars/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
---
22

33
system_packages:
4-
- python-dev
4+
- python3-dev
55
- git
6-
- python-virtualenv
76
- g++
87
- gcc
98
- libpq-dev
109
- postgresql
1110
- postgresql-common
1211
- postgresql-contrib
13-
- python-psycopg2
12+
- python3-psycopg2
1413
- nginx
1514
- vim
1615
# needed for the ansible apt_repository module
17-
- python-apt
16+
- python3-apt
1817
# - libsemanage-python
19-
- python
18+
- python3
19+
- python3-virtualenv
2020

2121
ssl_requirements:
2222
- openssl

deploy/playbooks/roles/postgresql/defaults/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22

3-
postgresql_version: 9.5
3+
postgresql_version: 16
44
postgresql_superuser: postgres
55
postgresql_cluster_name: main
66

@@ -175,7 +175,6 @@ postgresql_cfg_ssl_key_file: '/etc/ssl/private/ssl-cert-snakeoil.key'
175175
#postgresql_cfg_ssl_renegotiation_limit:
176176
#postgresql_cfg_standard_conforming_strings:
177177
#postgresql_cfg_statement_timeout:
178-
postgresql_cfg_stats_temp_directory: '/var/run/postgresql/{{ postgresql_version }}-{{ postgresql_cluster_name }}.pg_stat_tmp'
179178
#postgresql_cfg_superuser_reserved_connections: 3
180179
#postgresql_cfg_synchronize_seqscans:
181180
#postgresql_cfg_synchronous_commit:

deploy/playbooks/roles/postgresql/tasks/install.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
become: true
55
apt:
66
pkg: "postgresql-{{ postgresql_version }}"
7-
state: installed
7+
state: present
88
update_cache: yes
99
cache_valid_time: 3600
1010

@@ -14,5 +14,5 @@
1414
state: present
1515
update_cache: yes
1616
cache_valid_time: 3600
17-
with_items: common_packages
17+
with_items: "{{ common_packages }}"
1818
become: true
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22

3-
- include: install.yml
3+
- import_tasks: install.yml
44

55
- name: ensure database service is up
66
service:
77
name: postgresql
88
state: started
99
become: true
1010

11-
- include: users.yml
11+
- import_tasks: users.yml
1212
when: "'postgresql_master' in group_names"
1313

14-
- include: configure.yml
14+
- import_tasks: configure.yml
1515
when: "'postgresql_master' in group_names"
1616

1717
- name: make {{ app_name }} database
@@ -22,6 +22,3 @@
2222
when: "'postgresql_master' in group_names"
2323
become_user: postgres
2424
become: true
25-
26-
- include: standby.yml
27-
when: "'postgresql_standby' in group_names"

0 commit comments

Comments
 (0)