diff --git a/molecule/debian/molecule.yml b/molecule/debian/molecule.yml index ad8717ea637a652fd9979fbede782232ab43fa96..55502176e0637e24bdf30882a1b467ff3977399f 100644 --- a/molecule/debian/molecule.yml +++ b/molecule/debian/molecule.yml @@ -21,5 +21,9 @@ verifier: driver: name: docker platforms: - - name: ics-ans-role-conda-debian - image: debian:9 + - name: ics-ans-role-conda-debian10 + image: debian:10 + - name: ics-ans-role-conda-debian11 + image: debian:11 + - name: ics-ans-role-conda-debian12 + image: debian:12 diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml index e9b2ec7c0397a2c4669200e7b8c192adfa2325fe..a63ebe3004794a101f762d185e8188a924132e27 100644 --- a/molecule/default/prepare.yml +++ b/molecule/default/prepare.yml @@ -1,7 +1,7 @@ --- - name: Prepare ics-ans-role-conda-rpm - hosts: ics-ans-role-conda-rpm - gather_facts: false + hosts: ics-ans-role-conda-rpm* + gather_facts: true tasks: - name: install conda rpm yum: diff --git a/molecule/default/tests/test_conda.py b/molecule/default/tests/test_conda.py index 627c5225235de7609ac29970e9f44f5a21f4358a..c242027a357ea4fbc285f37f51895adad04b01ea 100644 --- a/molecule/default/tests/test_conda.py +++ b/molecule/default/tests/test_conda.py @@ -32,8 +32,7 @@ def test_mamba_path(host): def test_condarc_file(host): condarc = host.file("/opt/conda/.condarc") if ( - host.ansible.get_variables()["inventory_hostname"] - == "ics-ans-role-conda-rpm" + host.ansible.get_variables()["inventory_hostname"].startswith("ics-ans-role-conda-rpm") ): assert ( condarc.content_string.strip() @@ -61,8 +60,7 @@ use_only_tar_bz2: True""" def test_condaz_default_env_file(host): condaz_default_env = host.file("/etc/profile.d/condaz_default_env.sh") if ( - host.ansible.get_variables()["inventory_hostname"] - == "ics-ans-role-conda-create-env" + host.ansible.get_variables()["inventory_hostname"].startswith("ics-ans-role-conda-create-env") ) or ( host.ansible.get_variables()["inventory_hostname"] == "ics-ans-role-conda-create-env-ess-linux" @@ -79,8 +77,7 @@ conda activate python36""" @pytest.mark.parametrize("name", ["/opt/conda", "/opt/conda/envs", "/opt/conda/pkgs"]) def test_conda_owner(host, name): if ( - host.ansible.get_variables()["inventory_hostname"] - == "ics-ans-role-conda-create-env" + host.ansible.get_variables()["inventory_hostname"].startswith("ics-ans-role-conda-create-env") ) or ( host.ansible.get_variables()["inventory_hostname"] == "ics-ans-role-conda-create-env-ess-linux" diff --git a/molecule/ubuntu/molecule.yml b/molecule/ubuntu/molecule.yml new file mode 100644 index 0000000000000000000000000000000000000000..71ad4ce8ca9e46426c67f04fe087207055327980 --- /dev/null +++ b/molecule/ubuntu/molecule.yml @@ -0,0 +1,56 @@ +--- +dependency: + name: galaxy +lint: | + set -e + yamllint . + ansible-lint + flake8 +provisioner: + name: ansible + playbooks: + converge: ../default/converge.yml + config_options: + defaults: + gather_timeout: 20 + inventory: + group_vars: + conda_create_env: + conda_env_files: + - "{{ playbook_dir }}/tests/python36_env.yml" + - https://gitlab.esss.lu.se/ics-ansible-galaxy/ics-ans-role-conda/raw/master/molecule/default/tests/python27_env.yml + conda_default_env: python36 + conda_owner: vagrant + conda_group: vagrant + conda_rpm: + conda_channels: + - conda-forge +scenario: + name: ubuntu +verifier: + name: testinfra + directory: ../default/tests/ +driver: + name: docker +platforms: + - name: ics-ans-role-conda-default-ubuntu20 + image: registry.esss.lu.se/ics-docker/ubuntu-systemd:focal + - name: ics-ans-role-conda-create-env-ubuntu20 + image: registry.esss.lu.se/ics-docker/ubuntu-systemd:focal + groups: + - conda_create_env + - name: ics-ans-role-conda-rpm-ubuntu20 + image: registry.esss.lu.se/ics-docker/ubuntu-systemd:focal + groups: + - conda_rpm + + - name: ics-ans-role-conda-default-ubuntu22 + image: registry.esss.lu.se/ics-docker/ubuntu-systemd:22.04 + - name: ics-ans-role-conda-create-env-ubuntu22 + image: registry.esss.lu.se/ics-docker/ubuntu-systemd:22.04 + groups: + - conda_create_env + - name: ics-ans-role-conda-rpm-ubuntu22 + image: registry.esss.lu.se/ics-docker/ubuntu-systemd:22.04 + groups: + - conda_rpm diff --git a/molecule/ubuntu/prepare.yml b/molecule/ubuntu/prepare.yml new file mode 100644 index 0000000000000000000000000000000000000000..a7af62c7a3218a37b9e2e6b24b2fb8651bb4e53d --- /dev/null +++ b/molecule/ubuntu/prepare.yml @@ -0,0 +1,22 @@ +--- +- name: Prepare ics-ans-role-conda-create-env + hosts: ics-ans-role-conda-create-env* + gather_facts: false + tasks: + - name: create vagrant user + user: + name: vagrant + state: present + +- name: Prepare ics-ans-role-conda-rpm + hosts: ics-ans-role-conda-rpm* + gather_facts: false + tasks: + - name: create conda directory + file: + name: /opt/conda + state: directory + - name: create dummy .condarc file + file: + path: /opt/conda/.condarc + state: touch