-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade repo for Ubuntu 22.04. (#190)
* Upgrade repo for Ubuntu 22.04. * Remove unnecessary Dockerfile from Molecule configuration. * Add python3-distutils package required by Ubuntu 22.04. * Use postgresql_privs module to set database user permissions. * Update linting. * Remove ntp from base packages installed as it is no longer necessary.
- Loading branch information
Showing
53 changed files
with
278 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
--- | ||
|
||
skip_list: | ||
- ANSIBLE0006 | ||
- ANSIBLE0012 | ||
# TODO: Remove free-form from the repo. | ||
- no-free-form | ||
- name[missing] | ||
# TODO: Fix this. | ||
- name[casing] | ||
# TODO: Test removing this from each task and see if there is a workaround. | ||
- no-changed-when |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
--- | ||
|
||
extends: default | ||
|
||
rules: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
update_apt_cache: true | ||
|
||
module_defaults: | ||
apt: | ||
ansible.builtin.apt: | ||
force_apt_get: true | ||
|
||
roles: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
-r requirements.txt | ||
|
||
molecule==3.3.4 | ||
molecule-docker==0.2.4 | ||
testinfra==3.2.1 | ||
yamllint==1.19.0 | ||
ansible-lint==6.14.6 | ||
flake8==3.9.1 | ||
molecule==4.0.4 | ||
molecule-docker==2.1.0 | ||
yamllint==1.30.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
ansible==4.2.0 | ||
ansible==7.4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
--- | ||
|
||
- name: Install the Avahi mDNS/DNS-SD daemon | ||
apt: name=avahi-daemon update_cache={{ update_apt_cache }} state=present | ||
ansible.builtin.apt: | ||
name: avahi-daemon | ||
update_cache: "{{ update_apt_cache }}" | ||
state: present | ||
tags: packages | ||
|
||
- name: Ensure the Avahi mDNS/DNS-SD daemon is running | ||
service: name=avahi-daemon state=started enabled=yes | ||
ansible.builtin.service: | ||
name: avahi-daemon | ||
state: started | ||
enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,40 @@ | ||
--- | ||
- name: Create swap file | ||
command: dd if=/dev/zero of={{ swap_file_path }} bs=1024 count={{ swap_file_size_kb }}k | ||
ansible.builtin.command: dd if=/dev/zero of={{ swap_file_path }} bs=1024 count={{ swap_file_size_kb }}k | ||
creates="{{ swap_file_path }}" | ||
tags: swap.file.create | ||
|
||
- name: Change swap file permissions | ||
file: path="{{ swap_file_path }}" | ||
owner=root | ||
group=root | ||
mode=0600 | ||
ansible.builtin.file: | ||
path: "{{ swap_file_path }}" | ||
owner: root | ||
group: root | ||
mode: "0600" | ||
tags: swap.file.permissions | ||
|
||
- name: Check swap file type | ||
command: file {{ swap_file_path }} | ||
ansible.builtin.command: file {{ swap_file_path }} | ||
register: swapfile | ||
tags: swap.file.mkswap | ||
changed_when: false | ||
|
||
- name: Make swap file | ||
command: "mkswap {{ swap_file_path }}" | ||
ansible.builtin.command: "mkswap {{ swap_file_path }}" | ||
when: swapfile.stdout.find('swap file') == -1 | ||
tags: swap.file.mkswap | ||
|
||
- name: Write swap entry in fstab | ||
mount: name=none | ||
src={{ swap_file_path }} | ||
fstype=swap | ||
opts=sw | ||
passno=0 | ||
dump=0 | ||
state=present | ||
ansible.posix.mount: | ||
name: none | ||
src: "{{ swap_file_path }}" | ||
fstype: swap | ||
opts: sw | ||
passno: 0 | ||
dump: 0 | ||
state: present | ||
tags: swap.fstab | ||
|
||
- name: Mount swap | ||
command: "swapon {{ swap_file_path }}" | ||
ansible.builtin.command: "swapon {{ swap_file_path }}" | ||
when: ansible_swaptotal_mb < 1 | ||
tags: swap.file.swapon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
--- | ||
|
||
- name: restart {{ celery_application_name }} | ||
supervisorctl: name={{ celery_application_name }} state=restarted | ||
community.general.supervisorctl: name={{ celery_application_name }} state=restarted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
|
||
- include: copy_scripts.yml | ||
- ansible.builtin.import_tasks: copy_scripts.yml | ||
tags: celery | ||
|
||
- include: setup_supervisor.yml | ||
- ansible.builtin.import_tasks: setup_supervisor.yml | ||
tags: celery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,47 @@ | ||
--- | ||
|
||
- name: Ensure the Supervisor service is running | ||
service: | ||
ansible.builtin.service: | ||
name: supervisor | ||
state: started | ||
enabled: yes | ||
enabled: true | ||
# TODO: This is likely due to a bug in Ansible. | ||
# Remove this line in the future. | ||
# See https://github.com/ansible/ansible/issues/75005 | ||
use: sysvinit | ||
|
||
- name: Create the Supervisor config file for {{ celery_application_name }} | ||
template: src=supervisor_{{ celery_application_name }}.conf.j2 | ||
ansible.builtin.template: src=supervisor_{{ celery_application_name }}.conf.j2 | ||
dest=/etc/supervisor/conf.d/{{ celery_application_name }}.conf | ||
mode=0644 | ||
|
||
- name: Create the {{ celery_application_name }} log directory | ||
file: path={{ celery_log_dir }} | ||
owner={{ celery_user }} | ||
group={{ celery_group }} | ||
state=directory | ||
- name: Create the log directory for {{ celery_application_name }} | ||
ansible.builtin.file: | ||
path: "{{ celery_log_dir }}" | ||
owner: "{{ celery_user }}" | ||
group: "{{ celery_group }}" | ||
state: directory | ||
mode: "0644" | ||
changed_when: false | ||
|
||
- name: Check for an existing celery logfile | ||
stat: | ||
ansible.builtin.stat: | ||
path: "{{ celery_log_file }}" | ||
register: p | ||
|
||
- name: Create (or retain) the {{ celery_application_name }} log file | ||
- name: Create (or retain) the log file for {{ celery_application_name }} | ||
# Removing until https://github.com/ansible/ansible/issues/45530 gets resolved. | ||
# copy: content="" | ||
# ansible.builtin.copy: content="" | ||
# dest={{ celery_log_file }} | ||
# owner={{ celery_user }} | ||
# group={{ celery_group }} | ||
# force=no | ||
file: | ||
ansible.builtin.file: | ||
path: "{{ celery_log_file }}" | ||
owner: "{{ celery_user }}" | ||
group: "{{ celery_group }}" | ||
state: '{{ "file" if p.stat.exists else "touch" }}' | ||
state: '{{ "file" if p.stat.exists else "touch" }}' | ||
mode: "0644" | ||
|
||
- name: Re-read the Supervisor config files | ||
supervisorctl: name={{ celery_application_name }} state=present | ||
community.general.supervisorctl: name={{ celery_application_name }} state=present |
Oops, something went wrong.