TripleO Ansible project repository. Contains playbooks for use with TripleO OpenStack deployments.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
tripleo-ansible/tripleo_ansible/roles/tripleo_podman/molecule/login/prepare.yml

84 lines
2.2 KiB

---
# Copyright 2019 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: Prepare
hosts: all
gather_facts: true
pre_tasks:
- name: set basic user fact
set_fact:
ansible_user: "{{ lookup('env', 'USER') }}"
when:
- ansible_user is undefined
- name: set basic home fact
set_fact:
ansible_user_dir: "{{ lookup('env', 'HOME') }}"
when:
- ansible_user_dir is undefined
roles:
- role: test_deps
tasks:
- name: Disable SELinux
become: true
selinux:
state: disabled
- 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
shell: |-
podman tag ubuntu:16.04 localhost:5000/my-ubuntu
podman run --entrypoint htpasswd registry:2.7.0 -Bbn testuser testpassword > {{ ansible_user_dir }}/auth/htpasswd
args:
executable: /bin/bash
- name: Create registry
podman_container:
name: registry
image: "registry:2.7.0"
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
include_role:
name: tripleo_podman
tasks_from: tripleo_podman_install.yml
vars_from: "redhat.yml"