Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to Ubuntu 20.04 #813

Merged
merged 6 commits into from
Jun 27, 2022
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
2 changes: 1 addition & 1 deletion bin/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
version: 3.1.0

- src: geerlingguy.postgresql
version: 1.4.5
version: 3.3.0

- src: libre_ops.wal2json
version: 1.0.5
Expand Down
6 changes: 3 additions & 3 deletions inventory/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ postgres_encoding: en_US.utf8
# Entries marked custom_* can be defined in /host_vars files, and will be appended
# to the defaults if present. Make sure you use the "list" notation with the dashes!

postgresql_version: "{% if ansible_distribution_major_version == '16' %}9.5{% else %}10{% endif %}"
postgresql_version: "{% if ansible_distribution_major_version == '16' %}9.5{% elif ansible_distribution_major_version == '18' %}10{% else %}12{% endif %}"
postgresql_data_dir: "/var/lib/postgresql/{{ postgresql_version }}/main"
postgresql_bin_path: "/usr/lib/postgresql/{{ postgresql_version }}/bin"
postgresql_config_path: "/etc/postgresql/{{ postgresql_version }}/main"
Expand Down Expand Up @@ -395,8 +395,8 @@ nginx_configs:
upstream:
- upstream rails { server unix:{{ puma_sock }} fail_timeout=0; }

# Use python2.7 interpeter
ansible_python_interpreter: '/usr/bin/python2.7'
# Set python interpeter to the symlink created by setup
ansible_python_interpreter: '/usr/bin/python'

# Fix for renamed branch in rbenv-install repo
rbenv_plugins:
Expand Down
8 changes: 8 additions & 0 deletions playbooks/provision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@
tags: logrotate

tasks:
- name: Fix Ruby # noqa 301
command:
cmd: bash -lc "rbenv uninstall -f {{ ruby_version }} && rbenv install {{ ruby_version }} && touch ~/.rbenv/versions/{{ ruby_version }}/.reinstalled"
creates: "~/.rbenv/versions/{{ ruby_version }}/.reinstalled"
become: yes
become_user: "{{ app_user }}"
when: ansible_distribution_major_version >= '20'

- meta: flush_handlers # Ensure handlers run successfully before reporting success

- name: notify slack
Expand Down
4 changes: 2 additions & 2 deletions playbooks/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
gather_facts: no
remote_user: root
tasks:
- name: Install python 2.7
- name: Install python
become: yes
raw: apt-get update -qq && apt-get install -qq python2.7
raw: test $(lsb_release -sr | cut -d . -f1) -lt 20 && (apt-get update -qq && apt-get install -qq python2.7 && ln -s /usr/bin/python2.7 /usr/bin/python) || (apt-get update -qq && apt-get install -qq python3 && ln -s /usr/bin/python3 /usr/bin/python)
tags: skip_ansible_lint

# Add the default user and ssh keys as root
Expand Down
12 changes: 11 additions & 1 deletion roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
packages:
# Ansible support
- python-pycurl
- python-psycopg2
- python3-psycopg2

# unknown why or if needed
Expand Down Expand Up @@ -44,6 +43,17 @@
- webp
tags: packages

- name: install base packages for old distros
apt:
name: "{{ packages }}"
become: yes
vars:
packages:
# Ansible support
- python-psycopg2
tags: packages
when: ansible_distribution_major_version <= '18'

- name: set up redis
include_tasks: redis.yml

Expand Down
2 changes: 1 addition & 1 deletion roles/compatibility/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
vars:
bionic_packages:
- software-properties-common
when: ansible_distribution_major_version == '18'
when: ansible_distribution_major_version >= '18'