Skip to content
Open
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
46 changes: 23 additions & 23 deletions .makim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ groups:
tasks_dir: ansible/roles/maps-upload/tasks
roles_dir: ansible/roles
vault_config: ansible/config/vault-config.yaml
targets:
tasks:
create-vault-config:
shell: bash
help: Create the vault configuration file
run: |
ansible-vault create "{{ vars.vault_config }}"
ansible-vault create "${{ vars.vault_config }}"
change-vault-config:
shell: bash
help: Edit the vault configuration file
run: |
ansible-vault edit "{{ vars.vault_config }}"
ansible-vault edit "${{ vars.vault_config }}"
change-vault-passwd:
shell: bash
help: Change the password of the vault configuration file
run: |
ansible-vault rekey "{{ vars.vault_config }}"
ansible-vault rekey "${{ vars.vault_config }}"

ansible:
vars:
Expand All @@ -32,13 +32,13 @@ groups:
roles_dir: ansible/roles
vault_config: ansible/config/vault-config.yaml

targets:
tasks:
containers-system-update:
shell: bash
help: Run ansible scripts for containers system update
run: |
ansible-playbook -i "{{ vars.hosts_dir }}" --ask-vault-pass \
--extra-vars "@{{ vars.vault_config }}" \
ansible-playbook -i "${{ vars.hosts_dir }}" --ask-vault-pass \
--extra-vars "${{ vars.vault_config }}" \
playbooks/containers-system-update.yaml --verbose

update-alertas:
Expand All @@ -54,17 +54,17 @@ groups:
type: string
required: true
run: |
ansible-playbook -i "{{ vars.hosts_dir }}" --ask-vault-pass \
--extra-vars "@{{ vars.vault_config }}" \
-e " yearweek={{ args.yearweek }} disease={{ args.disease }}" \
ansible-playbook -i "${{ vars.hosts_dir }}" --ask-vault-pass \
--extra-vars "${{ vars.vault_config }}" \
-e " yearweek=${{ args.yearweek }} disease=${{ args.disease }}" \
playbooks/historico-alert-prepare-hosts.yaml --verbose

sync-maps:
shell: bash
help: Execute the playbook for incidence map upload
run: |
ansible-playbook -i "{{ vars.hosts_dir }}" --ask-vault-pass \
--extra-vars "@{{ vars.vault_config }}" \
ansible-playbook -i "${{ vars.hosts_dir }}" --ask-vault-pass \
--extra-vars "${{ vars.vault_config }}" \
playbooks/incidence-map-upload.yaml --verbose

upload-sinan-dbf:
Expand All @@ -90,21 +90,21 @@ groups:
required: false
default: "DEN"
run: |
FILE="{{args.file_path}}"
FILE="${{args.file_path}}"
FILE="${FILE%/}"
FILE_SUFFIX="${FILE##*.}"

EXPORT_DATE=$(date +"%m-%d-%Y")
DISEASE="{{ args.disease|upper }}"
DISEASE="${{ args.disease|upper }}"

case $DISEASE in CHIK) CID="A92.0";; ZIKA) CID="A928";; *) CID="A90";; esac

ansible-playbook -i "{{ vars.hosts_dir }}" --ask-vault-pass \
--extra-vars "@{{ vars.vault_config }}" \
-e " file_path={{ args.file_path }} \
code_area={{ args.codarea|upper }} \
disease={{ args.disease|upper }} \
notif_year={{ args.year }} \
ansible-playbook -i "${{ vars.hosts_dir }}" --ask-vault-pass \
--extra-vars "${{ vars.vault_config }}" \
-e " file_path=${{ args.file_path }} \
code_area=${{ args.codarea|upper }} \
disease=${{ args.disease|upper }} \
notif_year=${{ args.year }} \
export_date=$EXPORT_DATE \
file_type=$FILE_SUFFIX \
cid=$CID" \
Expand All @@ -124,6 +124,6 @@ groups:
type: string
required: false
run: |
ansible -i "{{ vars.hosts_dir }}" --ask-vault-pass \
--extra-vars "@{{ vars.vault_config }}" \
-m command -a "cat /var/log/ansible/{{ args.logfile }}" all --verbose
ansible -i "${{ vars.hosts_dir }}" --ask-vault-pass \
--extra-vars "${{ vars.vault_config }}" \
-m command -a "cat /var/log/ansible/${{ args.logfile }}" all --verbose
4 changes: 2 additions & 2 deletions ansible/roles/sinan/scripts/upload_sinan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ activate_env() {

run_upload_sinan() {
echo -e "\n >>> Executing load_sinan command on AlertaDengue <<< \n"
cd /opt/services/AlertaDengue
# cd /opt/services/staging_AlertaDengue
# cd /opt/services/AlertaDengue
cd /opt/services/staging_AlertaDengue
output=$(sugar exec --service worker --cmd python manage.py load_sinan $FILE $YEAR --default-cid $CID 2>&1)
if [[ $output == *"Errno 2"* || $output == *"Traceback"* ]]; then
echo "Something went wrong: $output"
Expand Down
4 changes: 1 addition & 3 deletions conda/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ channels:
- conda-forge
dependencies:
- pip
- makim
- ansible
- make
- poetry
Loading