Implement tripleo-container-tag role

A new Ansible role to tag containers managed by Pacemaker.
This role will be consummed by services managed by Pacemaker.

Requirements
------------

It requires Docker or Podman on the host, depending which container CLI
is used.

Role variables
--------------

- container_image: -- Name of the container image to tag.
- container_image_latest: -- Name of the tag.
- container_cli: -- Name of the Container CLI tool (default to docker).

Example Playbook
----------------

Sample playbook to call the role:

  - name: Tag Pacemaker containers
    hosts: all
    roles:
      - tripleo-container-tag
    vars:
      container_image: haproxy
      container_image_latest: pcmklatest
      container_cli: docker

In THT, we'll consume this role for pacemaker-managed services, so we
can tag the images during the deployment, the updates and the upgrades
by using the same Ansible task.

Change-Id: I61039cdaa6798e8ae7c918f772d863dc1b67ae02
This commit is contained in:
Emilien Macchi 2018-11-02 08:31:49 -04:00
parent 1ee3c59dc7
commit 82bf5adc58
4 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
features:
- |
A new Ansible role to tag containers managed by Pacemaker.
This role will be consummed by services managed by Pacemaker.

View File

@ -0,0 +1,41 @@
tripleo-container-tag
=====================
An Ansible role to tag Pacemaker-managed containers.
Requirements
------------
It requires Docker or Podman on the host, depending which container CLI
is used.
Role variables
--------------
- container_image: -- Name of the container image to tag.
- container_image_latest: -- Name of the tag.
- container_cli: -- Name of the Container CLI tool (default to docker).
Example Playbook
----------------
Sample playbook to call the role:
- name: Tag Pacemaker containers
hosts: all
roles:
- tripleo-container-tag
vars:
container_image: haproxy
container_image_latest: pcmklatest
container_cli: docker
License
-------
Free software: Apache License (2.0)
Author Information
------------------
OpenStack TripleO team

View File

@ -0,0 +1,2 @@
---
container_cli: docker

View File

@ -0,0 +1,3 @@
---
- name: Tag {{ container_image_latest }} to latest {{ container_image }} image
shell: "{{ container_cli }} tag {{container_image}} {{container_image_latest}}"