diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 6189242..39df0e5 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -132,5 +132,6 @@ scenario: - create - prepare - converge + - idempotence - cleanup - destroy \ No newline at end of file diff --git a/tasks/apt.yml b/tasks/apt.yml index 948a8f6..6d92860 100644 --- a/tasks/apt.yml +++ b/tasks/apt.yml @@ -1,4 +1,9 @@ --- +- name: Check if apt config file exists + stat: + path: /etc/apt/apt.conf.d/proxy.conf + register: stat_result + - name: Create apt config file file: path: /etc/apt/apt.conf.d/proxy.conf @@ -6,6 +11,7 @@ mode: 0600 when: - ansible_pkg_mgr == "apt" + - not stat_result.stat.exists - name: Ensure HTTP Proxy server is in apt.conf lineinfile: