diff --git a/.yamllint b/.yamllint index 929a0eb..497a061 100644 --- a/.yamllint +++ b/.yamllint @@ -14,3 +14,4 @@ ignore: | .travis.yml .ansible-lint .yamllint + .github diff --git a/README.md b/README.md index 5e74400..e1e9c39 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ This role work on RedHat, CentOS, Amazon Linux, Debian and Ubuntu distributions * stream8 * Rocky Linux * 8 + * 9 * Amazon Linux * 2 * Ubuntu @@ -52,6 +53,7 @@ This role work on RedHat, CentOS, Amazon Linux, Debian and Ubuntu distributions * 18.* * 20.* * 21.* + * 22.* * Debian * Stretch (9) * buster (10) diff --git a/meta/main.yml b/meta/main.yml index e9290f3..02baca5 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -30,6 +30,7 @@ galaxy_info: - bionic - focal - impish + - jammy galaxy_tags: - aws diff --git a/molecule/centos-7/INSTALL.rst b/molecule/centos-7/INSTALL.rst index d926ca2..1993c73 100644 --- a/molecule/centos-7/INSTALL.rst +++ b/molecule/centos-7/INSTALL.rst @@ -1,11 +1,11 @@ ******* -Docker driver installation guide +podman driver installation guide ******* Requirements ============ -* Docker Engine +* podman Engine Install ======= @@ -19,4 +19,4 @@ widely recommended `'--user' flag`_ when invoking ``pip``. .. code-block:: bash - $ python3 -m pip install 'molecule[docker]' + $ python3 -m pip install 'molecule[podman]' diff --git a/molecule/centos-7/molecule.yml b/molecule/centos-7/molecule.yml index 2858b63..2a109d8 100644 --- a/molecule/centos-7/molecule.yml +++ b/molecule/centos-7/molecule.yml @@ -3,7 +3,7 @@ dependency: name: galaxy driver: - name: docker + name: podman provisioner: name: ansible diff --git a/molecule/centos-7/tests/test_default.py b/molecule/centos-7/tests/test_default.py deleted file mode 100644 index eedd64a..0000000 --- a/molecule/centos-7/tests/test_default.py +++ /dev/null @@ -1,14 +0,0 @@ -import os - -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - - -def test_hosts_file(host): - f = host.file('/etc/hosts') - - assert f.exists - assert f.user == 'root' - assert f.group == 'root' diff --git a/molecule/centos-8/INSTALL.rst b/molecule/centos-8/INSTALL.rst index d926ca2..1993c73 100644 --- a/molecule/centos-8/INSTALL.rst +++ b/molecule/centos-8/INSTALL.rst @@ -1,11 +1,11 @@ ******* -Docker driver installation guide +podman driver installation guide ******* Requirements ============ -* Docker Engine +* podman Engine Install ======= @@ -19,4 +19,4 @@ widely recommended `'--user' flag`_ when invoking ``pip``. .. code-block:: bash - $ python3 -m pip install 'molecule[docker]' + $ python3 -m pip install 'molecule[podman]' diff --git a/molecule/centos-8/molecule.yml b/molecule/centos-8/molecule.yml index 627461e..5625701 100644 --- a/molecule/centos-8/molecule.yml +++ b/molecule/centos-8/molecule.yml @@ -3,7 +3,7 @@ dependency: name: galaxy driver: - name: docker + name: podman provisioner: name: ansible diff --git a/molecule/centos-8/tests/test_default.py b/molecule/centos-8/tests/test_default.py deleted file mode 100644 index eedd64a..0000000 --- a/molecule/centos-8/tests/test_default.py +++ /dev/null @@ -1,14 +0,0 @@ -import os - -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - - -def test_hosts_file(host): - f = host.file('/etc/hosts') - - assert f.exists - assert f.user == 'root' - assert f.group == 'root' diff --git a/molecule/default/INSTALL.rst b/molecule/default/INSTALL.rst index d926ca2..1993c73 100644 --- a/molecule/default/INSTALL.rst +++ b/molecule/default/INSTALL.rst @@ -1,11 +1,11 @@ ******* -Docker driver installation guide +podman driver installation guide ******* Requirements ============ -* Docker Engine +* podman Engine Install ======= @@ -19,4 +19,4 @@ widely recommended `'--user' flag`_ when invoking ``pip``. .. code-block:: bash - $ python3 -m pip install 'molecule[docker]' + $ python3 -m pip install 'molecule[podman]' diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index ee61dd3..ccc1c58 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -3,7 +3,7 @@ dependency: name: galaxy driver: - name: docker + name: podman provisioner: name: ansible diff --git a/molecule/default/tests/test_default.py b/molecule/default/tests/test_default.py deleted file mode 100644 index eedd64a..0000000 --- a/molecule/default/tests/test_default.py +++ /dev/null @@ -1,14 +0,0 @@ -import os - -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - - -def test_hosts_file(host): - f = host.file('/etc/hosts') - - assert f.exists - assert f.user == 'root' - assert f.group == 'root' diff --git a/molecule/docker/INSTALL.rst b/molecule/docker/INSTALL.rst index d926ca2..1993c73 100644 --- a/molecule/docker/INSTALL.rst +++ b/molecule/docker/INSTALL.rst @@ -1,11 +1,11 @@ ******* -Docker driver installation guide +podman driver installation guide ******* Requirements ============ -* Docker Engine +* podman Engine Install ======= @@ -19,4 +19,4 @@ widely recommended `'--user' flag`_ when invoking ``pip``. .. code-block:: bash - $ python3 -m pip install 'molecule[docker]' + $ python3 -m pip install 'molecule[podman]' diff --git a/molecule/docker/tests/test_default.py b/molecule/docker/tests/test_default.py deleted file mode 100644 index eedd64a..0000000 --- a/molecule/docker/tests/test_default.py +++ /dev/null @@ -1,14 +0,0 @@ -import os - -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - - -def test_hosts_file(host): - f = host.file('/etc/hosts') - - assert f.exists - assert f.user == 'root' - assert f.group == 'root' diff --git a/molecule/docker/verify.yml b/molecule/docker/verify.yml new file mode 100644 index 0000000..e707420 --- /dev/null +++ b/molecule/docker/verify.yml @@ -0,0 +1,10 @@ +--- +# This is an example playbook to execute Ansible tests. + +- name: Verify + hosts: all + gather_facts: false + tasks: + - name: Example assertion + ansible.builtin.assert: + that: true diff --git a/molecule/podman/INSTALL.rst b/molecule/podman/INSTALL.rst index 8d73cdb..1993c73 100644 --- a/molecule/podman/INSTALL.rst +++ b/molecule/podman/INSTALL.rst @@ -1,11 +1,11 @@ ******* -Docker driver installation guide +podman driver installation guide ******* Requirements ============ -* Docker Engine +* podman Engine Install ======= diff --git a/molecule/podman/tests/test_default.py b/molecule/podman/tests/test_default.py deleted file mode 100644 index eedd64a..0000000 --- a/molecule/podman/tests/test_default.py +++ /dev/null @@ -1,14 +0,0 @@ -import os - -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - - -def test_hosts_file(host): - f = host.file('/etc/hosts') - - assert f.exists - assert f.user == 'root' - assert f.group == 'root' diff --git a/molecule/redhat-8/INSTALL.rst b/molecule/redhat-8/INSTALL.rst index 8d73cdb..1993c73 100644 --- a/molecule/redhat-8/INSTALL.rst +++ b/molecule/redhat-8/INSTALL.rst @@ -1,11 +1,11 @@ ******* -Docker driver installation guide +podman driver installation guide ******* Requirements ============ -* Docker Engine +* podman Engine Install ======= diff --git a/molecule/redhat-8/converge.yml b/molecule/redhat-8/converge.yml index b0c4d05..43d7ccb 100644 --- a/molecule/redhat-8/converge.yml +++ b/molecule/redhat-8/converge.yml @@ -2,19 +2,6 @@ - name: Converge hosts: all - pre_tasks: - - name: Update apt cache - apt: update_cache=true cache_valid_time=600 - when: ansible_os_family == 'Debian' - changed_when: false - - - name: Install gnupg - apt: - name: gnupg - state: latest - when: ansible_os_family == 'Debian' - changed_when: false - tasks: - name: "Include christiangda.epel_repo" include_role: diff --git a/molecule/redhat-8/tests/test_default.py b/molecule/redhat-8/tests/test_default.py deleted file mode 100644 index eedd64a..0000000 --- a/molecule/redhat-8/tests/test_default.py +++ /dev/null @@ -1,14 +0,0 @@ -import os - -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - - -def test_hosts_file(host): - f = host.file('/etc/hosts') - - assert f.exists - assert f.user == 'root' - assert f.group == 'root' diff --git a/molecule/rocky-8/INSTALL.rst b/molecule/rocky-8/INSTALL.rst new file mode 100644 index 0000000..1993c73 --- /dev/null +++ b/molecule/rocky-8/INSTALL.rst @@ -0,0 +1,22 @@ +******* +podman driver installation guide +******* + +Requirements +============ + +* podman Engine + +Install +======= + +Please refer to the `Virtual environment`_ documentation for installation best +practices. If not using a virtual environment, please consider passing the +widely recommended `'--user' flag`_ when invoking ``pip``. + +.. _Virtual environment: https://virtualenv.pypa.io/en/latest/ +.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site + +.. code-block:: bash + + $ python3 -m pip install 'molecule[podman]' diff --git a/molecule/rocky-8/converge.yml b/molecule/rocky-8/converge.yml new file mode 100644 index 0000000..43d7ccb --- /dev/null +++ b/molecule/rocky-8/converge.yml @@ -0,0 +1,37 @@ +--- +- name: Converge + hosts: all + + tasks: + - name: "Include christiangda.epel_repo" + include_role: + name: christiangda.epel_repo + + - name: "Include christiangda.awscli_configure" + include_role: + name: christiangda.awscli_configure + + roles: + - role: christiangda.epel_repo + when: > + ansible_os_family == 'RedHat' and ( + ansible_distribution == 'CentOS' or + ansible_distribution == 'RedHat' or + ansible_distribution == 'Amazon' + ) + - role: christiangda.awscli_configure + vars: + awscliconf_path: "/root" + awscliconf_files: + credentials: + - AmazonCloudWatchAgent: + aws_access_key_id: "AKIAIOSFODNN7EXAMPLE" + aws_secret_access_key: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" + config: + - profile AmazonCloudWatchAgent: + region: eu-west-1 + - role: christiangda.amazon_cloudwatch_agent + vars: + cwa_agent_mode: "onPremise" + cwa_profile: "AmazonCloudWatchAgent" + cwa_aws_region: "eu-west-1" diff --git a/molecule/rocky-8/molecule.yml b/molecule/rocky-8/molecule.yml new file mode 100644 index 0000000..0ffab48 --- /dev/null +++ b/molecule/rocky-8/molecule.yml @@ -0,0 +1,26 @@ +--- +dependency: + name: galaxy + +driver: + name: podman + +provisioner: + name: ansible + # log: true + +verifier: + name: ansible + +scenario: + name: rocky-8 + +platforms: + - name: rocky-8 + image: rockylinux:8 + pre_build_image: true + +# lint: | +# set -e +# yamllint . +# ansible-lint . diff --git a/molecule/rocky-8/requirements.yml b/molecule/rocky-8/requirements.yml new file mode 100644 index 0000000..d0b1bf6 --- /dev/null +++ b/molecule/rocky-8/requirements.yml @@ -0,0 +1,3 @@ +--- +- src: christiangda.epel_repo +- src: christiangda.awscli_configure diff --git a/molecule/rocky-8/verify.yml b/molecule/rocky-8/verify.yml new file mode 100644 index 0000000..e707420 --- /dev/null +++ b/molecule/rocky-8/verify.yml @@ -0,0 +1,10 @@ +--- +# This is an example playbook to execute Ansible tests. + +- name: Verify + hosts: all + gather_facts: false + tasks: + - name: Example assertion + ansible.builtin.assert: + that: true diff --git a/molecule/rocky-9/INSTALL.rst b/molecule/rocky-9/INSTALL.rst new file mode 100644 index 0000000..1993c73 --- /dev/null +++ b/molecule/rocky-9/INSTALL.rst @@ -0,0 +1,22 @@ +******* +podman driver installation guide +******* + +Requirements +============ + +* podman Engine + +Install +======= + +Please refer to the `Virtual environment`_ documentation for installation best +practices. If not using a virtual environment, please consider passing the +widely recommended `'--user' flag`_ when invoking ``pip``. + +.. _Virtual environment: https://virtualenv.pypa.io/en/latest/ +.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site + +.. code-block:: bash + + $ python3 -m pip install 'molecule[podman]' diff --git a/molecule/rocky-9/converge.yml b/molecule/rocky-9/converge.yml new file mode 100644 index 0000000..43d7ccb --- /dev/null +++ b/molecule/rocky-9/converge.yml @@ -0,0 +1,37 @@ +--- +- name: Converge + hosts: all + + tasks: + - name: "Include christiangda.epel_repo" + include_role: + name: christiangda.epel_repo + + - name: "Include christiangda.awscli_configure" + include_role: + name: christiangda.awscli_configure + + roles: + - role: christiangda.epel_repo + when: > + ansible_os_family == 'RedHat' and ( + ansible_distribution == 'CentOS' or + ansible_distribution == 'RedHat' or + ansible_distribution == 'Amazon' + ) + - role: christiangda.awscli_configure + vars: + awscliconf_path: "/root" + awscliconf_files: + credentials: + - AmazonCloudWatchAgent: + aws_access_key_id: "AKIAIOSFODNN7EXAMPLE" + aws_secret_access_key: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" + config: + - profile AmazonCloudWatchAgent: + region: eu-west-1 + - role: christiangda.amazon_cloudwatch_agent + vars: + cwa_agent_mode: "onPremise" + cwa_profile: "AmazonCloudWatchAgent" + cwa_aws_region: "eu-west-1" diff --git a/molecule/rocky-9/molecule.yml b/molecule/rocky-9/molecule.yml new file mode 100644 index 0000000..ca2baf2 --- /dev/null +++ b/molecule/rocky-9/molecule.yml @@ -0,0 +1,21 @@ +--- +dependency: + name: galaxy + +driver: + name: podman + +provisioner: + name: ansible + # log: true + +verifier: + name: ansible + +scenario: + name: rocky-9 + +platforms: + - name: rocky-9 + image: rockylinux:9.0 + pre_build_image: true diff --git a/molecule/rocky-9/requirements.yml b/molecule/rocky-9/requirements.yml new file mode 100644 index 0000000..d0b1bf6 --- /dev/null +++ b/molecule/rocky-9/requirements.yml @@ -0,0 +1,3 @@ +--- +- src: christiangda.epel_repo +- src: christiangda.awscli_configure diff --git a/molecule/rocky-9/verify.yml b/molecule/rocky-9/verify.yml new file mode 100644 index 0000000..e707420 --- /dev/null +++ b/molecule/rocky-9/verify.yml @@ -0,0 +1,10 @@ +--- +# This is an example playbook to execute Ansible tests. + +- name: Verify + hosts: all + gather_facts: false + tasks: + - name: Example assertion + ansible.builtin.assert: + that: true diff --git a/molecule/ubuntu-21.04/INSTALL.rst b/molecule/ubuntu-21.04/INSTALL.rst index d926ca2..1993c73 100644 --- a/molecule/ubuntu-21.04/INSTALL.rst +++ b/molecule/ubuntu-21.04/INSTALL.rst @@ -1,11 +1,11 @@ ******* -Docker driver installation guide +podman driver installation guide ******* Requirements ============ -* Docker Engine +* podman Engine Install ======= @@ -19,4 +19,4 @@ widely recommended `'--user' flag`_ when invoking ``pip``. .. code-block:: bash - $ python3 -m pip install 'molecule[docker]' + $ python3 -m pip install 'molecule[podman]' diff --git a/molecule/ubuntu-21.04/converge.yml b/molecule/ubuntu-21.04/converge.yml index d04d804..fb287fe 100644 --- a/molecule/ubuntu-21.04/converge.yml +++ b/molecule/ubuntu-21.04/converge.yml @@ -9,10 +9,6 @@ changed_when: false tasks: - - name: "Include christiangda.epel_repo" - include_role: - name: christiangda.epel_repo - - name: "Include christiangda.awscli_configure" include_role: name: christiangda.awscli_configure diff --git a/molecule/ubuntu-21.04/molecule.yml b/molecule/ubuntu-21.04/molecule.yml index 35c5e82..bbf15f7 100644 --- a/molecule/ubuntu-21.04/molecule.yml +++ b/molecule/ubuntu-21.04/molecule.yml @@ -3,7 +3,7 @@ dependency: name: galaxy driver: - name: docker + name: podman provisioner: name: ansible diff --git a/molecule/ubuntu-21.04/tests/test_default.py b/molecule/ubuntu-21.04/tests/test_default.py deleted file mode 100644 index eedd64a..0000000 --- a/molecule/ubuntu-21.04/tests/test_default.py +++ /dev/null @@ -1,14 +0,0 @@ -import os - -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - - -def test_hosts_file(host): - f = host.file('/etc/hosts') - - assert f.exists - assert f.user == 'root' - assert f.group == 'root' diff --git a/molecule/ubuntu-22.04/INSTALL.rst b/molecule/ubuntu-22.04/INSTALL.rst new file mode 100644 index 0000000..1993c73 --- /dev/null +++ b/molecule/ubuntu-22.04/INSTALL.rst @@ -0,0 +1,22 @@ +******* +podman driver installation guide +******* + +Requirements +============ + +* podman Engine + +Install +======= + +Please refer to the `Virtual environment`_ documentation for installation best +practices. If not using a virtual environment, please consider passing the +widely recommended `'--user' flag`_ when invoking ``pip``. + +.. _Virtual environment: https://virtualenv.pypa.io/en/latest/ +.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site + +.. code-block:: bash + + $ python3 -m pip install 'molecule[podman]' diff --git a/molecule/ubuntu-22.04/converge.yml b/molecule/ubuntu-22.04/converge.yml new file mode 100644 index 0000000..fb287fe --- /dev/null +++ b/molecule/ubuntu-22.04/converge.yml @@ -0,0 +1,39 @@ +--- +- name: Converge + hosts: all + + pre_tasks: + - name: Update apt cache. + apt: update_cache=true cache_valid_time=600 + when: ansible_os_family == 'Debian' + changed_when: false + + tasks: + - name: "Include christiangda.awscli_configure" + include_role: + name: christiangda.awscli_configure + + roles: + - role: christiangda.epel_repo + when: > + ansible_os_family == 'RedHat' and ( + ansible_distribution == 'CentOS' or + ansible_distribution == 'RedHat' or + ansible_distribution == 'Amazon' + ) + - role: christiangda.awscli_configure + vars: + awscliconf_path: "/root" + awscliconf_files: + credentials: + - AmazonCloudWatchAgent: + aws_access_key_id: "AKIAIOSFODNN7EXAMPLE" + aws_secret_access_key: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" + config: + - profile AmazonCloudWatchAgent: + region: eu-west-1 + - role: christiangda.amazon_cloudwatch_agent + vars: + cwa_agent_mode: "onPremise" + cwa_profile: "AmazonCloudWatchAgent" + cwa_aws_region: "eu-west-1" diff --git a/molecule/ubuntu-22.04/molecule.yml b/molecule/ubuntu-22.04/molecule.yml new file mode 100644 index 0000000..e452cb4 --- /dev/null +++ b/molecule/ubuntu-22.04/molecule.yml @@ -0,0 +1,20 @@ +--- +dependency: + name: galaxy + +driver: + name: podman + +provisioner: + name: ansible + # log: true + +verifier: + name: ansible + +scenario: + name: ubuntu-22.04 + +platforms: + - name: ubuntu-22.04 + image: ubuntu:22.04 diff --git a/molecule/ubuntu-22.04/requirements.yml b/molecule/ubuntu-22.04/requirements.yml new file mode 100644 index 0000000..d0b1bf6 --- /dev/null +++ b/molecule/ubuntu-22.04/requirements.yml @@ -0,0 +1,3 @@ +--- +- src: christiangda.epel_repo +- src: christiangda.awscli_configure diff --git a/molecule/vagrant/INSTALL.rst b/molecule/vagrant/INSTALL.rst index d926ca2..1993c73 100644 --- a/molecule/vagrant/INSTALL.rst +++ b/molecule/vagrant/INSTALL.rst @@ -1,11 +1,11 @@ ******* -Docker driver installation guide +podman driver installation guide ******* Requirements ============ -* Docker Engine +* podman Engine Install ======= @@ -19,4 +19,4 @@ widely recommended `'--user' flag`_ when invoking ``pip``. .. code-block:: bash - $ python3 -m pip install 'molecule[docker]' + $ python3 -m pip install 'molecule[podman]' diff --git a/tasks/install-redhat.yml b/tasks/install-redhat.yml index 7dbe8f3..3b18f82 100644 --- a/tasks/install-redhat.yml +++ b/tasks/install-redhat.yml @@ -57,7 +57,7 @@ tags: - install - - name: Install {{ cwa_dependencies_packages }} dependency on {{ansible_distribution}} 6/7/8 + - name: Install {{ cwa_dependencies_packages }} dependency on {{ ansible_distribution }} 6/7/8/9 yum: name: "{{ cwa_dependencies_packages }}" state: present @@ -71,6 +71,7 @@ ansible_distribution == 'RedHat' or ansible_distribution == 'Rocky' ) and ( + ansible_distribution_major_version == '9' or ansible_distribution_major_version == '8' or ansible_distribution_major_version == '7' or ansible_distribution_major_version == '6' @@ -95,7 +96,7 @@ tags: - install -- name: Install {{ cwa_package }}.rpm on {{ansible_distribution}} 6/7 +- name: Install {{ cwa_package }}.rpm on {{ ansible_distribution }} 6/7 yum: name: "{{ cwa_temp_path }}/{{ cwa_package }}.rpm" disable_gpg_check: true @@ -117,7 +118,7 @@ tags: - install -- name: Install {{ cwa_package }}.rpm on {{ansible_distribution}} 8 +- name: Install {{ cwa_package }}.rpm on {{ ansible_distribution }} 8/9 dnf: name: "{{ cwa_temp_path }}/{{ cwa_package }}.rpm" disable_gpg_check: true @@ -131,8 +132,10 @@ ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat' or ansible_distribution == 'Rocky' - ) and - ansible_distribution_major_version == '8' + ) and ( + ansible_distribution_major_version == '9' or + ansible_distribution_major_version == '8' + ) ignore_errors: "{{ ansible_check_mode }}" tags: - install diff --git a/tasks/main.yml b/tasks/main.yml index bf3d3f6..6a724a4 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -29,11 +29,11 @@ cwa_arch_name: "{{ cwa_arch_names.get(ansible_architecture) }}" # Include of vars -- name: Include variables for {{ ansible_distribution|lower }} +- name: Include variables for {{ ansible_distribution | lower }} include_vars: "{{ item }}" with_first_found: - - "{{ ansible_distribution|lower }}-{{ ansible_distribution_major_version }}.yml" - - "{{ ansible_distribution|lower }}.yml" + - "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version }}.yml" + - "{{ ansible_distribution | lower }}.yml" - "main.yml" when: > ansible_os_family == 'RedHat' or ansible_os_family == 'Debian' @@ -41,15 +41,15 @@ - include-vars # Installation tasks -- name: Include tasks for installation on {{ ansible_os_family|lower }} distribution - include_tasks: "install-{{ ansible_os_family|lower }}.yml" +- name: Include tasks for installation on {{ ansible_os_family | lower }} distribution + include_tasks: "install-{{ ansible_os_family | lower }}.yml" when: > ansible_os_family == 'RedHat' or ansible_os_family == 'Debian' tags: - include-install-task # Configuration tasks -- name: Configure {{ cwa_package }} for {{ ansible_distribution|lower }} +- name: Configure {{ cwa_package }} for {{ ansible_distribution | lower }} include_tasks: "configure.yml" tags: - configure diff --git a/vars/main.yml b/vars/main.yml index 0e494d5..1fa5d0a 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -24,11 +24,11 @@ cwa_temp_path: /tmp cwa_agent_profile_credentials_file: "{{ cwa_agent_profile_path }}/.aws/credentials" # Conditional variables -cwa_use_proxy: "{{ true|bool if cwa_http_proxy is defined and cwa_http_proxy|length > 0 else false|bool }}" -cwa_use_conf_json_template: "{{ false|bool if cwa_conf_json_file_content is defined and cwa_conf_json_file_content|length > 0 else true|bool }}" +cwa_use_proxy: "{{ true | bool if cwa_http_proxy is defined and cwa_http_proxy | length > 0 else false | bool }}" +cwa_use_conf_json_template: "{{ false | bool if cwa_conf_json_file_content is defined and cwa_conf_json_file_content | length > 0 else true | bool }}" # defined in defaults/main.yaml -cwa_need_credentials: "{{ true|bool if cwa_agent_mode == 'onPremise' else cwa_use_credentials }}" +cwa_need_credentials: "{{ true | bool if cwa_agent_mode == 'onPremise' else cwa_use_credentials }}" cwa_arch_names: { "x86_64": "amd64", diff --git a/vars/rocky-9.yml b/vars/rocky-9.yml new file mode 100644 index 0000000..e7019d3 --- /dev/null +++ b/vars/rocky-9.yml @@ -0,0 +1,3 @@ +--- +cwa_package_url: https://s3.amazonaws.com/amazoncloudwatch-agent/centos/{{ cwa_arch_name }}/latest/amazon-cloudwatch-agent.rpm +cwa_package_signature: https://s3.amazonaws.com/amazoncloudwatch-agent/centos/{{ cwa_arch_name }}/latest/amazon-cloudwatch-agent.rpm.sig