--- - hosts: localhost connection: local tasks: - name: Install podman ansible.builtin.dnf: name: '@container-tools:ol8' state: present become: yes when: - ansible_distribution == 'OracleLinux' - ansible_facts['distribution_major_version'] == '8' - name: Install podman ansible.builtin.dnf: name: 'container-tools' state: present become: yes when: - ansible_distribution == 'OracleLinux' - ansible_facts['distribution_major_version'] == '9' - name: Pull oraclelinux:8 from GitHub containers.podman.podman_image: name: ghcr.io/oracle/oraclelinux:9 - name: Ensure the destination directory exists ansible.builtin.file: path: "/home/oracle/nginx/" state: directory - name: Create an empty file ansible.builtin.file: path: "/home/oracle/nginx/index.html" state: touch mode: '0755' - name: Create index.html ansible.builtin.copy: dest: "/home/oracle/nginx/index.html" content: | Hello! Welcome to Oracle Linux Containers. - name: Run image containers.podman.podman_container: name: my-ol8 image: ghcr.io/oracle/oraclelinux9-nginx:1.20 state: started detach: yes expose: - '80' - '443' publish: - '8080:80' volume: "/home/oracle/nginx:/usr/share/nginx/html:Z"