From ada9caffd6810e2bfbe997c74c00388f8e22dc78 Mon Sep 17 00:00:00 2001 From: Rafael Gomes Date: Sat, 19 Mar 2022 11:53:38 -0300 Subject: [PATCH 1/4] Precisamos atualizar os pacotes Aplicar as exceptions --- .ansible-lint | 3 +++ ansible.cfg | 2 +- requirements.txt | 13 ++++++------- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.ansible-lint b/.ansible-lint index e5c78c9..0434e67 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -8,3 +8,6 @@ exclude_paths: - ./roles/ - ./.github/ - ./requirements.yml + - ./molecule/ +warn_list: # or 'skip_list' to silence them completely + - internal-error diff --git a/ansible.cfg b/ansible.cfg index fa1b88c..ebf2921 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -20,7 +20,7 @@ callback_whitelist = profile_tasks inventory_ignore_extensions = secrets.py, .pyc, .cfg, .crt, .ini timeout = 30 # define o arquivo acesso ao segredo do vault -vault_password_file = /tmp/vault_password_file +#vault_password_file = /tmp/vault_password_file # Descomente para usar o inventário exemplo #inventory = inventory/hosts.example diff --git a/requirements.txt b/requirements.txt index 8a123f5..9b50111 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,8 @@ -ansible==2.10.5 -ansible-lint==4.3.7 -docker==4.4.1 -molecule==3.2.2 -molecule-docker==0.2.4 -pytest==6.2.1 +ansible==5.3.0 +docker==4.4.4 pytest-testinfra==6.1.0 -testinfra==6.0.0 +molecule==3.6.1 +molecule-docker==1.1.0 +ansible-lint==6.0.1 yamllint==1.25.0 +ansible-core==2.12.2 \ No newline at end of file From 85edb40efbef92aba7405a87601bd73a4f0844f7 Mon Sep 17 00:00:00 2001 From: Rafael Gomes Date: Sat, 19 Mar 2022 12:02:11 -0300 Subject: [PATCH 2/4] Corrigir o problema do lint --- .ansible-lint | 2 -- ansible.cfg | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.ansible-lint b/.ansible-lint index 0434e67..fa403d7 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -9,5 +9,3 @@ exclude_paths: - ./.github/ - ./requirements.yml - ./molecule/ -warn_list: # or 'skip_list' to silence them completely - - internal-error diff --git a/ansible.cfg b/ansible.cfg index ebf2921..58a1b7f 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -23,7 +23,7 @@ timeout = 30 #vault_password_file = /tmp/vault_password_file # Descomente para usar o inventário exemplo -#inventory = inventory/hosts.example +inventory = hosts.example [inventory] # Falha quando o parse do inventário não passar (Ansible 2.4+) From c713f9ec5e4a9764acaa7b9b7bd5c7b403d393be Mon Sep 17 00:00:00 2001 From: Rafael Gomes Date: Sat, 19 Mar 2022 12:05:23 -0300 Subject: [PATCH 3/4] Corrigir falhas no yamllint --- .yamllint | 2 ++ group_vars/production/vars.yml | 3 +-- playbook.yml | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.yamllint b/.yamllint index 843da50..058f152 100644 --- a/.yamllint +++ b/.yamllint @@ -5,6 +5,8 @@ ignore: | meta/ roles/ .venv/ + group_vars/staging/vault.yml + group_vars/production/vault.yml rules: braces: diff --git a/group_vars/production/vars.yml b/group_vars/production/vars.yml index 8cbe700..5bdb95d 100644 --- a/group_vars/production/vars.yml +++ b/group_vars/production/vars.yml @@ -11,7 +11,7 @@ apps_config: # CLOUDAMQP_URL: "{{ cloudamqp_url }}" # CLOUDAMQP_APIKEY: "{{ cloudamqp_apikey }}" CITY_COUNCIL_WEBSERVICE: "https://www.transparencia.feiradesantana.ba.leg.br/" - CITY_COUNCIL_WEBSERVICE_ENDPOINT: "http://transparencia.feiradesantana.ba.leg.br/webservice" + CITY_COUNCIL_WEBSERVICE_ENDPOINT: "http://transparencia.feiradesantana.ba.leg.br/webservice" DJANGO_ALLOWED_HOSTS: ".mq.dadosabertosdefeira.com.br" DJANGO_CONFIGURATION: "Prod" DJANGO_SETTINGS_MODULE: "web.settings" @@ -23,7 +23,6 @@ apps_config: SENTRY_ENVIRONMENT: "Prod" SPIDERMON_SENTRY_ENVIRONMENT_TYPE: "Prod" TIKA_CLIENT_ONLY: "1" - # NEWRELIC INFRA nrinfragent_integrations: diff --git a/playbook.yml b/playbook.yml index 6f4ba73..ae349bb 100644 --- a/playbook.yml +++ b/playbook.yml @@ -28,14 +28,14 @@ config: "{{ apps_config }}" when: apps_config is defined - #ignore_errors: yes + # ignore_errors: yes - name: environment configuration vault dokku_config: app: "{{ app }}" config: "{{ apps_config_vault }}" when: apps_config_vault is defined - #ignore_errors: yes + # ignore_errors: yes - name: Add dokku_service network to mariaquiteria command: "dokku network:set {{ app }} attach-post-create dokku_services" args: From 19f63c8fdfd50893bf476609739c7e03683ae0e3 Mon Sep 17 00:00:00 2001 From: Rafael Gomes Date: Sat, 19 Mar 2022 12:10:51 -0300 Subject: [PATCH 4/4] Corrigir erro de ansible.builtin --- playbook.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/playbook.yml b/playbook.yml index ae349bb..e911dff 100644 --- a/playbook.yml +++ b/playbook.yml @@ -3,7 +3,7 @@ become: yes pre_tasks: - name: Atualizando apt cache - apt: + ansible.builtin.apt: update_cache: yes cache_valid_time: 600 when: ansible_os_family == 'Debian' @@ -14,7 +14,7 @@ - iac-role-services tasks: - name: copying log files config - copy: + ansible.builtin.copy: src: config_files/logging.yml dest: /etc/newrelic-infra/logging.d mode: 0644 @@ -37,7 +37,7 @@ when: apps_config_vault is defined # ignore_errors: yes - name: Add dokku_service network to mariaquiteria - command: "dokku network:set {{ app }} attach-post-create dokku_services" + ansible.builtin.command: "dokku network:set {{ app }} attach-post-create dokku_services" args: creates: "/tmp/network_dokku_services_mariaquiteria_{{ env }}" changed_when: "'molecule-idempotence-notest' not in ansible_skip_tags"