diff --git a/molecule/default/Dockerfile.j2 b/molecule/default/Dockerfile.j2 new file mode 100644 index 0000000..177e430 --- /dev/null +++ b/molecule/default/Dockerfile.j2 @@ -0,0 +1,14 @@ +FROM registry.access.redhat.com/ubi9/python-311:latest + +USER 0 + +CMD ["/sbin/init"] + +STOPSIGNAL SIGRTMIN+3 + +#mask systemd-machine-id-commit.service - partial fix for https://bugzilla.redhat.com/show_bug.cgi?id=1472439 +RUN systemctl mask systemd-remount-fs.service dev-hugepages.mount sys-fs-fuse-connections.mount systemd-logind.service getty.target console-getty.service systemd-udev-trigger.service systemd-udevd.service systemd-random-seed.service systemd-machine-id-commit.service + +RUN dnf -y install sudo procps-ng && dnf clean all + + diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index 1dbee9c..417713f 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -13,13 +13,6 @@ keycloak_quarkus_proxy_mode: none keycloak_quarkus_offline_install: true keycloak_quarkus_download_path: /tmp/keycloak/ - pre_tasks: - - name: "Install iproute" - become: true - ansible.builtin.dnf: - name: - - iproute - state: present roles: - role: keycloak_quarkus - role: keycloak_realm diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 4dde2a6..07d64b9 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -3,13 +3,10 @@ driver: name: docker platforms: - name: instance - image: registry.access.redhat.com/ubi9/ubi-init:latest - pre_build_image: true + pre_build_image: false privileged: true command: "/usr/sbin/init" - networks: - - name: "mymongo" - network_mode: "mymongo" + image: ubi9-py311-init:latest port_bindings: - "8080/tcp" - "8443/tcp" @@ -27,10 +24,11 @@ provisioner: verify: verify.yml inventory: host_vars: - localhost: - ansible_python_interpreter: "{{ ansible_playbook_python }}" + instance: + ansible_python_interpreter: "/bin/python3.11" env: ANSIBLE_FORCE_COLOR: "true" + ANSIBLE_VERBOSITY: 3 verifier: name: ansible scenario: diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml index 99763d0..de39012 100644 --- a/molecule/default/prepare.yml +++ b/molecule/default/prepare.yml @@ -7,19 +7,26 @@ tasks: - name: "Run preparation common to all scenario" ansible.builtin.include_tasks: ../prepare.yml - vars: - assets: - - "{{ assets_server }}/sso/7.6.0/rh-sso-7.6.0-server-dist.zip" - - "{{ assets_server }}/sso/7.6.1/rh-sso-7.6.1-patch.zip" - debug: var: ansible_python_version - - debug: - msg: "{{ ansible_facts.packages[item] }}" - loop: "{{ ansible_facts.packages | select('search', regex) }}" - vars: - regex: 'python*' + - command: id root + - command: cat /etc/sudoers + + - lineinfile: + path: /etc/sudoers + regexp: '^root' + line: 'root ALL=(ALL) NOPASSWD: ALL' + + - command: cat /etc/sudoers + + - name: "Install iproute" + become: true + ansible.builtin.dnf: + name: + - iproute + state: present - name: Create controller directory for downloads ansible.builtin.file: # noqa risky-file-permissions delegated, uses controller host user @@ -29,10 +36,10 @@ delegate_to: localhost run_once: true - - name: Download keycloak archive to controller directory - ansible.builtin.get_url: # noqa risky-file-permissions delegated, uses controller host user - url: https://github.com/keycloak/keycloak/releases/download/24.0.5/keycloak-24.0.5.zip - dest: /tmp/keycloak - mode: '0640' - delegate_to: localhost - run_once: true + # - name: Download keycloak archive to controller directory + # ansible.builtin.get_url: # noqa risky-file-permissions delegated, uses controller host user + # url: https://github.com/keycloak/keycloak/releases/download/24.0.5/keycloak-24.0.5.zip + # dest: /tmp/keycloak + # mode: '0640' + # delegate_to: localhost + # run_once: true