Replace podman commands by module
Change-Id: I62814cc874cad88990b3e90da2787107e8c141a1
This commit is contained in:
parent
0c0f904ef5
commit
a621d89d6a
|
@ -32,10 +32,17 @@
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
- name: Pull container image
|
- name: Pull container image
|
||||||
command: "podman pull fedora"
|
podman_image:
|
||||||
|
name: fedora
|
||||||
|
|
||||||
- name: Create test containers
|
- name: Create test containers
|
||||||
command: "podman run -itd --systemd true --name {{ item }} fedora bash"
|
podman_container:
|
||||||
|
name: "{{ item }}"
|
||||||
|
interactive: true
|
||||||
|
tty: true
|
||||||
|
detach: true
|
||||||
|
image: fedora
|
||||||
|
command: bash
|
||||||
with_items:
|
with_items:
|
||||||
- podman-container1
|
- podman-container1
|
||||||
- podman-container2
|
- podman-container2
|
||||||
|
|
|
@ -32,10 +32,17 @@
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
- name: Pull container image
|
- name: Pull container image
|
||||||
command: "podman pull fedora"
|
podman_image:
|
||||||
|
name: fedora
|
||||||
|
|
||||||
- name: Create test containers
|
- name: Create test containers
|
||||||
command: "podman run -itd --systemd true --name {{ item }} fedora bash"
|
podman_container:
|
||||||
|
name: "{{ item }}"
|
||||||
|
interactive: true
|
||||||
|
tty: true
|
||||||
|
detach: true
|
||||||
|
image: fedora
|
||||||
|
command: bash
|
||||||
with_items:
|
with_items:
|
||||||
- podman-legacy-container1
|
- podman-legacy-container1
|
||||||
- podman-legacy-container2
|
- podman-legacy-container2
|
||||||
|
|
|
@ -32,16 +32,25 @@
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
- name: Pull container image
|
- name: Pull container image
|
||||||
command: "podman pull fedora"
|
podman_image:
|
||||||
|
name: fedora
|
||||||
|
|
||||||
- name: Create test containers
|
- name: Create test containers
|
||||||
command: "podman run -itd --systemd true --name {{ item }} fedora bash"
|
podman_container:
|
||||||
|
name: "{{ item }}"
|
||||||
|
interactive: true
|
||||||
|
tty: true
|
||||||
|
detach: true
|
||||||
|
image: fedora
|
||||||
|
command: bash
|
||||||
with_items:
|
with_items:
|
||||||
- podman-container1
|
- podman-container1
|
||||||
- podman-container2
|
- podman-container2
|
||||||
|
|
||||||
- name: Stop test containers
|
- name: Stop test containers
|
||||||
command: "podman stop {{ item }}"
|
podman_container:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: stopped
|
||||||
with_items:
|
with_items:
|
||||||
- podman-container1
|
- podman-container1
|
||||||
- podman-container2
|
- podman-container2
|
||||||
|
|
|
@ -32,10 +32,17 @@
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
- name: Pull container image
|
- name: Pull container image
|
||||||
command: "podman pull fedora"
|
podman_image:
|
||||||
|
name: fedora
|
||||||
|
|
||||||
- name: Create test containers
|
- name: Create test containers
|
||||||
command: "podman run -itd --systemd true --name {{ item }} fedora bash"
|
podman_container:
|
||||||
|
name: "{{ item }}"
|
||||||
|
interactive: true
|
||||||
|
tty: true
|
||||||
|
detach: true
|
||||||
|
image: fedora
|
||||||
|
command: bash
|
||||||
with_items:
|
with_items:
|
||||||
- podman-container1
|
- podman-container1
|
||||||
- podman-container2
|
- podman-container2
|
||||||
|
|
|
@ -38,9 +38,15 @@
|
||||||
shell: "podman build -t keystone-img -f {{ playbook_dir }}/Dockerfile.keystone ."
|
shell: "podman build -t keystone-img -f {{ playbook_dir }}/Dockerfile.keystone ."
|
||||||
become: false
|
become: false
|
||||||
|
|
||||||
- name: Run keystone container
|
- name: Create test containers
|
||||||
shell: |-
|
podman_container:
|
||||||
podman rm --force keystone-podman || true
|
name: keystone-podman
|
||||||
podman run -d -p 5000:5000 --name keystone-podman keystone-img
|
image: keystone-img
|
||||||
sleep 30
|
detach: true
|
||||||
|
ports:
|
||||||
|
- "5000:5000"
|
||||||
become: false
|
become: false
|
||||||
|
|
||||||
|
- name: Give keystone time to go up
|
||||||
|
pause:
|
||||||
|
seconds: 30
|
||||||
|
|
|
@ -35,23 +35,44 @@
|
||||||
- role: test_deps
|
- role: test_deps
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
|
- name: Ensure registry doesn't exist
|
||||||
|
podman_container:
|
||||||
|
name: registry
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Pull ubuntu image
|
||||||
|
podman_image:
|
||||||
|
name: ubuntu
|
||||||
|
tag: 16.04
|
||||||
|
|
||||||
|
- name: Create auth directory
|
||||||
|
file:
|
||||||
|
state: directory
|
||||||
|
path: "{{ ansible_user_dir }}/auth"
|
||||||
|
|
||||||
- name: Create registry
|
- name: Create registry
|
||||||
shell: |-
|
shell: |-
|
||||||
podman container rm --force registry || true
|
|
||||||
podman pull ubuntu:16.04
|
|
||||||
podman tag ubuntu:16.04 localhost:5000/my-ubuntu
|
podman tag ubuntu:16.04 localhost:5000/my-ubuntu
|
||||||
mkdir -p {{ ansible_user_dir }}/auth
|
|
||||||
podman run --entrypoint htpasswd registry:2 -Bbn testuser testpassword > {{ ansible_user_dir }}/auth/htpasswd
|
podman run --entrypoint htpasswd registry:2 -Bbn testuser testpassword > {{ ansible_user_dir }}/auth/htpasswd
|
||||||
podman run -d -p 5000:5000 --restart=always \
|
|
||||||
--name registry \
|
|
||||||
-v "{{ ansible_user_dir }}/auth:/auth" \
|
|
||||||
-e "REGISTRY_AUTH=htpasswd" \
|
|
||||||
-e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" \
|
|
||||||
-e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd \
|
|
||||||
registry:2
|
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
|
|
||||||
|
- name: Create registry
|
||||||
|
podman_container:
|
||||||
|
name: registry
|
||||||
|
image: "registry:2"
|
||||||
|
restart_policy: always
|
||||||
|
detach: true
|
||||||
|
ports:
|
||||||
|
- "5000:5000"
|
||||||
|
volume:
|
||||||
|
- "{{ ansible_user_dir }}/auth:/auth"
|
||||||
|
env:
|
||||||
|
REGISTRY_AUTH: "htpasswd"
|
||||||
|
REGISTRY_AUTH_HTPASSWD_REALM: "Registry Realm"
|
||||||
|
REGISTRY_AUTH_HTPASSWD_PATH: "/auth/htpasswd"
|
||||||
|
|
||||||
- name: Run install
|
- name: Run install
|
||||||
include_role:
|
include_role:
|
||||||
name: tripleo_podman
|
name: tripleo_podman
|
||||||
|
|
Loading…
Reference in New Issue