From b14f67423c17ade06885dde018e76d8d8811da62 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 22 Sep 2023 16:45:39 +1000 Subject: [PATCH 1/3] Test with Ubuntu 20 for supported CI runners Github doesn't have Ubuntu 18 runners any more. --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f2324117a..f72096544 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ on: jobs: ansible-lint: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 @@ -25,7 +25,7 @@ jobs: run: ansible-lint playbooks/*.yml --exclude community playbook-tests: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 From 9e38fa0adc4691c9c0e997927022737d73495cfe Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Mon, 25 Sep 2023 16:44:20 +1000 Subject: [PATCH 2/3] Remove old Datadog code offending linting checks --- bin/requirements.yml | 3 --- playbooks/provision.yml | 4 ---- roles/datadog/tasks/main.yml | 37 ----------------------------- roles/datadog/tasks/nginx_stats.yml | 14 ----------- roles/datadog/tasks/pg_stats.yml | 32 ------------------------- 5 files changed, 90 deletions(-) delete mode 100644 roles/datadog/tasks/main.yml delete mode 100644 roles/datadog/tasks/nginx_stats.yml delete mode 100644 roles/datadog/tasks/pg_stats.yml diff --git a/bin/requirements.yml b/bin/requirements.yml index 58915e8ea..731d7cd10 100644 --- a/bin/requirements.yml +++ b/bin/requirements.yml @@ -14,9 +14,6 @@ - src: oefenweb.swapfile version: v2.0.14 -- src: Datadog.datadog - version: 4.16.0 - - src: geerlingguy.postgresql version: 3.4.0 diff --git a/playbooks/provision.yml b/playbooks/provision.yml index 049d94d83..68ce1a530 100644 --- a/playbooks/provision.yml +++ b/playbooks/provision.yml @@ -98,10 +98,6 @@ - role: webserver tags: webserver - - role: datadog - become: yes - tags: datadog - - role: arillso.logrotate become: yes tags: logrotate diff --git a/roles/datadog/tasks/main.yml b/roles/datadog/tasks/main.yml deleted file mode 100644 index f66c1c351..000000000 --- a/roles/datadog/tasks/main.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -- name: remove old, failing config - lineinfile: - name: "/etc/apt/sources.list.d/pgdg.list" - line: "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" - state: absent - -- name: remove old apt source without valid key - lineinfile: - name: "/etc/apt/sources.list.d/apt_datadoghq_com.list" - line: "deb https://apt.datadoghq.com/ stable 6" - state: absent - -- name: remove current apt source - file: - path: "/etc/apt/sources.list.d/ansible_datadog_7.list" - state: absent - -- name: remove datadog package - apt: - name: datadog-agent - state: absent - autoremove: yes - -- name: remove datadog keys package - apt: - name: datadog-signing-keys - state: absent - autoremove: yes - -- name: set up postgres stats collection - import_tasks: pg_stats.yml - when: datadog_key is defined and datadog_db_password is defined - -- name: set up nginx stats collection - import_tasks: nginx_stats.yml - when: datadog_key is defined diff --git a/roles/datadog/tasks/nginx_stats.yml b/roles/datadog/tasks/nginx_stats.yml deleted file mode 100644 index 361fd2eef..000000000 --- a/roles/datadog/tasks/nginx_stats.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- name: remove nginx stub_status - file: - path: /etc/nginx/conf.d/status.conf - state: absent - become: yes - notify: - - reload nginx - -- name: remove datadog nginx integration - file: - path: /etc/datadog-agent/conf.d/nginx.d/conf.yaml - state: absent - become: true diff --git a/roles/datadog/tasks/pg_stats.yml b/roles/datadog/tasks/pg_stats.yml deleted file mode 100644 index d062a8973..000000000 --- a/roles/datadog/tasks/pg_stats.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -- name: remove postgres stats configuration - file: - path: "{{ postgresql_config_path }}/conf.d/stats.conf" - state: absent - become: yes - notify: restart postgres - -- name: remove postgres logging configuration - file: - dest: "{{ postgresql_config_path }}/conf.d/logging.conf" - state: absent - become: yes - notify: restart postgres - -- name: remove datadog postgres integration - file: - dest: /etc/datadog-agent/conf.d/postgres.d/conf.yaml - state: absent - become: true - -- name: remove pg_stat_activity_dd view - command: "psql {{ db }} -c 'DROP VIEW IF EXISTS pg_stat_activity_dd;'" - become: yes - become_user: postgres - notify: restart postgres - -- name: remove pg_stat_activity function - command: "psql {{ db }} -c 'DROP FUNCTION IF EXISTS pg_stat_activity();'" - become: yes - become_user: postgres - notify: restart postgres From ba655d126c07d6998b471fee56e5e9955b73ad62 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Mon, 25 Sep 2023 17:00:41 +1000 Subject: [PATCH 3/3] Add change condition on for linting We actually know that the file is not there because we just created a new build directory but it's good style to add these things. --- roles/deploy/tasks/deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/deploy/tasks/deploy.yml b/roles/deploy/tasks/deploy.yml index c1968d6c7..fa8b81ae7 100644 --- a/roles/deploy/tasks/deploy.yml +++ b/roles/deploy/tasks/deploy.yml @@ -64,6 +64,7 @@ " args: chdir: "{{ build_path }}" + creates: "{{ build_path }}/.bundle/config" become: true become_user: "{{ app_user }}"