Skip to content

Commit

Permalink
add python3 to CentOS appliances; use python3 psycopg2 for PG management
Browse files Browse the repository at this point in the history
  • Loading branch information
YanChii committed Oct 19, 2019
1 parent 2f01410 commit d8d20e5
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
6 changes: 6 additions & 0 deletions ansible/roles/esdc-mgmt/tasks/esdc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
- GeoIP
- python-requests
- python-httplib2
- python36
- python36-virtualenv
- python36-pip
- python36-requests
- python36-httplib2
- libxml2
- libxslt
- rsync
Expand All @@ -28,6 +33,7 @@
- make
- postgresql{{ pg_version_nodot }}-devel
- python-devel
- python36-devel
- libffi-devel
- zlib-devel
- libevent-devel
Expand Down
2 changes: 2 additions & 0 deletions ansible/roles/esdc-mon/tasks/02-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
with_items:
- python-requests
- python-pip
- python36-requests
- python36-pip

- name: Install zabbix-api-erigones (zabbix_template module)
shell: pip install -U zabbix-api-erigones
Expand Down
5 changes: 2 additions & 3 deletions ansible/roles/postgresql/defaults/CentOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ pg_packages:
- "postgresql{{ pg_version_nodot }}-libs"
- "postgresql{{ pg_version_nodot }}-server"
- "postgresql{{ pg_version_nodot }}-contrib"
#- "python-psycopg2" (revert after migration to python3)
# compiled for pg95:
- "https://download.erigones.org/rpm/python-psycopg2-dc-2.7.5-1.el7.x86_64.rpm"
- "python-psycopg2"
- "python36-psycopg2"

pg_datadir: "/var/lib/pgsql/{{ pg_version }}/data/"
pg_backupdir: "/var/lib/pgsql/{{ pg_version }}/backups"
Expand Down
6 changes: 6 additions & 0 deletions ansible/roles/postgresql/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
state: "{{ item.value.state | default('present') }}"
with_dict: "{{ postgresql_users }}"
when: postgresql_users
vars:
ansible_python_interpreter: /usr/bin/python3

- name: Make sure the PostgreSQL databases are present
postgresql_db:
Expand All @@ -80,6 +82,8 @@
state: "{{ item.state | default('present') }}"
with_items: "{{ postgresql_databases }}"
when: postgresql_databases
vars:
ansible_python_interpreter: /usr/bin/python3

- name: Add hstore to the databases with the requirement
become: yes
Expand All @@ -96,6 +100,8 @@
state: "{{ item.state | default('present') }}"
with_items: "{{ postgresql_user_privileges }}"
when: postgresql_user_privileges
vars:
ansible_python_interpreter: /usr/bin/python3

- name: Install PostgreSQL backup script
template: src=backup_pgsql.sh.j2 dest=/usr/local/sbin/backup_pgsql.sh mode=0700 owner=root group=root
Expand Down
1 change: 1 addition & 0 deletions ansible/templates/centos-7/ks.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ logging --level=debug
-plymouth*
-chrony

python3
bzip2
yum-utils
acpid
Expand Down
4 changes: 2 additions & 2 deletions ansible/vars/build/vm/base-centos-7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ builder_download_url: "{{ builder.appliance.url }}/base-centos-7/_build"
centos_mirror: "{{ builder_centos_mirror }}/7/os/x86_64/images/pxeboot"
centos_files:
- file: vmlinuz
sha256sum: 225fd77bec0f02dd6abba7ad39332ffededb7778d8b01ba3bb921027b468eef8
sha256sum: 156ddeaccea0ee51eb9af42b2551f393f84d6adaf7d257fa5b174657d38cead6
- file: initrd.img
sha256sum: 38ac551a17a33410c456d8bde4c9c25464e061239906b2d316882474daeec0ea
sha256sum: 8c97a6f32ae8ab59425bdff8321eb8d99827313fb51e5498e2fcb438befa3d83
zone_brand: kvm
zone_vnc_port: "{{ build_vnc_ports.base_centos7 | default(build_vnc_port) | mandatory }}"
zone_uuid: 316ae519-a88e-49e1-8eb3-d55d36aecbbf
Expand Down

0 comments on commit d8d20e5

Please sign in to comment.