From 4a5e9cbe4e86e7cbfebbf49830be9d57ff00cd80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Gonz=C3=A1lez=20Di=20Antonio?= Date: Mon, 30 Dec 2019 16:47:13 +0100 Subject: [PATCH] implemented issue #8, support for playbooks with --check option --- .ansible-lint | 0 .gitignore | 0 .travis.yml | 0 .yamllint | 0 LICENSE | 0 README.md | 0 VERSION | 2 +- VERSION.md | 4 ++++ defaults/main.yml | 0 handlers/main.yml | 0 meta/main.yml | 0 molecule/default/Dockerfile.j2 | 0 molecule/default/INSTALL.rst | 0 molecule/default/molecule.yml | 0 molecule/default/playbook.yml | 0 molecule/default/prepare.yml | 0 molecule/default/requirements.yml | 0 molecule/default/tests/test_default.py | 0 molecule/vagrant/INSTALL.rst | 0 molecule/vagrant/molecule.yml | 0 molecule/vagrant/playbook.yml | 0 molecule/vagrant/prepare.yml | 0 molecule/vagrant/tests/test_log_rotate.py | 0 tasks/configure.yml | 2 ++ tasks/install-debian.yml | 1 + tasks/install-redhat.yml | 3 +++ tasks/main.yml | 0 templates/agent/amazon-cloudwatch-agent.json.j2 | 0 templates/agent/common-config.toml.j2 | 0 templates/logrotate/aws-cwa.j2 | 0 vars/amazon.yml | 0 vars/centos.yml | 0 vars/debian.yml | 0 vars/main.yml | 0 vars/redhat.yml | 0 vars/ubuntu.yml | 0 36 files changed, 11 insertions(+), 1 deletion(-) mode change 100644 => 100755 .ansible-lint mode change 100644 => 100755 .gitignore mode change 100644 => 100755 .travis.yml mode change 100644 => 100755 .yamllint mode change 100644 => 100755 LICENSE mode change 100644 => 100755 README.md mode change 100644 => 100755 VERSION mode change 100644 => 100755 VERSION.md mode change 100644 => 100755 defaults/main.yml mode change 100644 => 100755 handlers/main.yml mode change 100644 => 100755 meta/main.yml mode change 100644 => 100755 molecule/default/Dockerfile.j2 mode change 100644 => 100755 molecule/default/INSTALL.rst mode change 100644 => 100755 molecule/default/molecule.yml mode change 100644 => 100755 molecule/default/playbook.yml mode change 100644 => 100755 molecule/default/prepare.yml mode change 100644 => 100755 molecule/default/requirements.yml mode change 100644 => 100755 molecule/default/tests/test_default.py mode change 100644 => 100755 molecule/vagrant/INSTALL.rst mode change 100644 => 100755 molecule/vagrant/molecule.yml mode change 100644 => 100755 molecule/vagrant/playbook.yml mode change 100644 => 100755 molecule/vagrant/prepare.yml mode change 100644 => 100755 molecule/vagrant/tests/test_log_rotate.py mode change 100644 => 100755 tasks/configure.yml mode change 100644 => 100755 tasks/install-debian.yml mode change 100644 => 100755 tasks/install-redhat.yml mode change 100644 => 100755 tasks/main.yml mode change 100644 => 100755 templates/agent/amazon-cloudwatch-agent.json.j2 mode change 100644 => 100755 templates/agent/common-config.toml.j2 mode change 100644 => 100755 templates/logrotate/aws-cwa.j2 mode change 100644 => 100755 vars/amazon.yml mode change 100644 => 100755 vars/centos.yml mode change 100644 => 100755 vars/debian.yml mode change 100644 => 100755 vars/main.yml mode change 100644 => 100755 vars/redhat.yml mode change 100644 => 100755 vars/ubuntu.yml diff --git a/.ansible-lint b/.ansible-lint old mode 100644 new mode 100755 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.travis.yml b/.travis.yml old mode 100644 new mode 100755 diff --git a/.yamllint b/.yamllint old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/VERSION b/VERSION old mode 100644 new mode 100755 index 38f77a6..e9307ca --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.1 +2.0.2 diff --git a/VERSION.md b/VERSION.md old mode 100644 new mode 100755 index 205640c..802bf55 --- a/VERSION.md +++ b/VERSION.md @@ -1,5 +1,9 @@ # VERSION Details +## 2.0.2 + +* Improved to support ansible playbooks with option `--check` reporte in issue #8 [playbook fails on --check](https://github.com/christiangda/ansible-role-amazon-cloudwatch-agent/issues/8) + ## 2.0.1 * Remove the need to install collectd package when you are not [Retrieve Custom Metrics with collectd](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-custom-metrics-collectd.html), reported in issue #7 --> [collectd is not a required dependency](https://github.com/christiangda/ansible-role-amazon-cloudwatch-agent/issues/7) diff --git a/defaults/main.yml b/defaults/main.yml old mode 100644 new mode 100755 diff --git a/handlers/main.yml b/handlers/main.yml old mode 100644 new mode 100755 diff --git a/meta/main.yml b/meta/main.yml old mode 100644 new mode 100755 diff --git a/molecule/default/Dockerfile.j2 b/molecule/default/Dockerfile.j2 old mode 100644 new mode 100755 diff --git a/molecule/default/INSTALL.rst b/molecule/default/INSTALL.rst old mode 100644 new mode 100755 diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml old mode 100644 new mode 100755 diff --git a/molecule/default/playbook.yml b/molecule/default/playbook.yml old mode 100644 new mode 100755 diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml old mode 100644 new mode 100755 diff --git a/molecule/default/requirements.yml b/molecule/default/requirements.yml old mode 100644 new mode 100755 diff --git a/molecule/default/tests/test_default.py b/molecule/default/tests/test_default.py old mode 100644 new mode 100755 diff --git a/molecule/vagrant/INSTALL.rst b/molecule/vagrant/INSTALL.rst old mode 100644 new mode 100755 diff --git a/molecule/vagrant/molecule.yml b/molecule/vagrant/molecule.yml old mode 100644 new mode 100755 diff --git a/molecule/vagrant/playbook.yml b/molecule/vagrant/playbook.yml old mode 100644 new mode 100755 diff --git a/molecule/vagrant/prepare.yml b/molecule/vagrant/prepare.yml old mode 100644 new mode 100755 diff --git a/molecule/vagrant/tests/test_log_rotate.py b/molecule/vagrant/tests/test_log_rotate.py old mode 100644 new mode 100755 diff --git a/tasks/configure.yml b/tasks/configure.yml old mode 100644 new mode 100755 index b0c37e4..d466b88 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -32,6 +32,8 @@ - "Line [{{ cwa_profile }}] is not present in file {{ cwa_agent_profile_credentials_file }}" failed_when: presence.changed when: profile_credentials_file.stat.exists is defined and profile_credentials_file.stat.exists and presence.changed + + ignore_errors: "{{ ansible_check_mode }}" when: cwa_use_credentials - name: Deploy {{ cwa_package }} common configuration file diff --git a/tasks/install-debian.yml b/tasks/install-debian.yml old mode 100644 new mode 100755 index 2984d0e..7d5929e --- a/tasks/install-debian.yml +++ b/tasks/install-debian.yml @@ -64,5 +64,6 @@ apt: deb: "{{ cwa_temp_path }}/{{ cwa_package }}.deb" state: present + ignore_errors: "{{ ansible_check_mode }}" tags: - install diff --git a/tasks/install-redhat.yml b/tasks/install-redhat.yml old mode 100644 new mode 100755 index ddddf7e..8b3f9f6 --- a/tasks/install-redhat.yml +++ b/tasks/install-redhat.yml @@ -89,6 +89,7 @@ when: > ansible_os_family == 'RedHat' and ansible_distribution == 'Amazon' + ignore_errors: "{{ ansible_check_mode }}" tags: - install @@ -109,6 +110,7 @@ ansible_distribution_major_version == '7' or ansible_distribution_major_version == '6' ) + ignore_errors: "{{ ansible_check_mode }}" tags: - install @@ -127,5 +129,6 @@ ansible_distribution == 'RedHat' ) and ansible_distribution_major_version == '8' + ignore_errors: "{{ ansible_check_mode }}" tags: - install diff --git a/tasks/main.yml b/tasks/main.yml old mode 100644 new mode 100755 diff --git a/templates/agent/amazon-cloudwatch-agent.json.j2 b/templates/agent/amazon-cloudwatch-agent.json.j2 old mode 100644 new mode 100755 diff --git a/templates/agent/common-config.toml.j2 b/templates/agent/common-config.toml.j2 old mode 100644 new mode 100755 diff --git a/templates/logrotate/aws-cwa.j2 b/templates/logrotate/aws-cwa.j2 old mode 100644 new mode 100755 diff --git a/vars/amazon.yml b/vars/amazon.yml old mode 100644 new mode 100755 diff --git a/vars/centos.yml b/vars/centos.yml old mode 100644 new mode 100755 diff --git a/vars/debian.yml b/vars/debian.yml old mode 100644 new mode 100755 diff --git a/vars/main.yml b/vars/main.yml old mode 100644 new mode 100755 diff --git a/vars/redhat.yml b/vars/redhat.yml old mode 100644 new mode 100755 diff --git a/vars/ubuntu.yml b/vars/ubuntu.yml old mode 100644 new mode 100755