Skip to content

A group of ansible common utils leveraged by the other product-specific ansible roles

License

Notifications You must be signed in to change notification settings

SoftwareAG/sagdevops-ansible-common

Repository files navigation

sagdevops-ansible-common

A group of ansible common utils leveraged by the other product-specific ansible roles

Note: For a sample Infrastructure-as-Code (IaC) project that leverages these roles, head on over to webmethods-ansible-api-gateway, maintained by SoftwareAG Government Solutions's

Authors

Fabien Sanglier

Using Containers

Pre-requisite - Base Ansible runner

If you haven't done dso already, make sure to have the "sagdevops-ansible-runner" built and ready. See instructions README-base-ansible.md for details.

Building the container

First set some environment variables to specify the build arguments:

export REG=
export TAG=0.0.1

Then, build the common utils image:

docker build --rm -f Dockerfile -t ${REG}sagdevops-ansible-common:latest -t ${REG}sagdevops-ansible-common:${TAG} --build-arg BASE_ANSIBLE_IMAGE=${REG}sagdevops-ansible-runner  .

This will create 1 container image with 2 tags (1 tagged with the build version, 1 tagged as "latest"):

  • ${REG}sagdevops-ansible-common:latest
  • ${REG}sagdevops-ansible-common:${TAG}

Test to make sure it's there:

docker images ${REG}sagdevops-ansible-common:${TAG}
docker images ${REG}sagdevops-ansible-common:latest

Testing validity of the containers

We'll be running the simplest ping.yml playbook added to this project for testing:

docker run -v $PWD/playbooks:/ansible/playbooks ${REG}sagdevops-ansible-common:${TAG} -v ping.yml

You should see the following output if all is well (notice the Task "ping" which should execute succesfully)

PLAY [all] *********************************************************************

TASK [Gathering Facts] *********************************************************
ok: [localhost]

TASK [ping] ********************************************************************
ok: [localhost] => {"changed": false, "ping": "pong"}

PLAY RECAP *********************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

At this point, the image should be ready to be used.


These tools are provided as-is and without warranty or support. They do not constitute part of the Software AG product suite. Users are free to use, fork and modify them, subject to the license agreement. While Software AG welcomes contributions, we cannot guarantee to include every contribution in the master project.


For more information you can Ask a Question in the TECHcommunity Forums.

You can find additional information in the Software AG TECHcommunity.


Contact us at TECHcommunity if you have any questions.

About

A group of ansible common utils leveraged by the other product-specific ansible roles

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published