From b4e45bc77d170df5c3f8e8b2e2e3370f43f9a8ed Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Mon, 23 Jan 2017 01:12:04 +0100 Subject: [PATCH] Fixing issue #4, ensuring APT stack is consistent. (#6) Merging pull-request. --- roles/domain/tasks/cleanup.yml | 9 +++++++++ roles/domain/tasks/main.yml | 6 ++++-- roles/prereq/tasks/prereq.yml | 3 +++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 roles/domain/tasks/cleanup.yml diff --git a/roles/domain/tasks/cleanup.yml b/roles/domain/tasks/cleanup.yml new file mode 100644 index 0000000..582d696 --- /dev/null +++ b/roles/domain/tasks/cleanup.yml @@ -0,0 +1,9 @@ +--- +# Final tasks. + +- name: Ensuring APT stack is healthy + shell: dpkg --configure -a && apt-get install -f + +# Correctly managing ansible-pull runs. +- name: Updating local version for repo + shell: 'rm -f {{ ansible_local.checksum.repover_file }} && echo "{{ ansible_local.checksum.repover }}" > {{ ansible_local.checksum.repover_file }}' diff --git a/roles/domain/tasks/main.yml b/roles/domain/tasks/main.yml index bc286aa..658a326 100644 --- a/roles/domain/tasks/main.yml +++ b/roles/domain/tasks/main.yml @@ -57,5 +57,7 @@ - domain - join -- name: Updating local version for repo - shell: 'rm -f {{ ansible_local.checksum.repover_file }} && echo "{{ ansible_local.checksum.repover }}" > {{ ansible_local.checksum.repover_file }}' +- include: cleanup.yml + tags: + - domain + - cleanup diff --git a/roles/prereq/tasks/prereq.yml b/roles/prereq/tasks/prereq.yml index 6dc1cf4..3c2b6d2 100644 --- a/roles/prereq/tasks/prereq.yml +++ b/roles/prereq/tasks/prereq.yml @@ -1,5 +1,8 @@ --- +- name: Fixing APT issues, every time. + shell: dpkg --configure -a && apt-get install -f + - name: Domain settings download get_url: url: "http://{{ ansible_default_ipv4.gateway }}:3000/domain"