Skip to content
aperture

GitHub Action

Check Ansible CentOS centos6

v0.5 Pre-release

Check Ansible CentOS centos6

aperture

Check Ansible CentOS centos6

Check ansible role or playbook with the centos:centos6 docker container

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Check Ansible CentOS centos6

uses: roles-ansible/check-ansible-centos-centos6-action@v0.5

Learn more about this action in roles-ansible/check-ansible-centos-centos6-action

Choose a version

Github Marketplace MIT License

Check Ansible CentOS centos6

This action allows you to test your ansible role or your playbook in a Docker Container with centos:centos6.

Usage

To use the action simply create an ansible-centos-centos6.yml (or choose custom *.yml name) in the .github/workflows/ directory.

For example:

name: Ansible check centos:centos6  # feel free to pick your own name

on: [push, pull_request]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    # Important: This sets up your GITHUB_WORKSPACE environment variable
    - uses: actions/checkout@v2

    - name: ansible check with centos:centos6
      # replace "master" with any valid ref
      uses: roles-ansible/check-ansible-centos-centos6-action@master
      with:
        targets: "./"
        #  [required]
        #   Paths to your ansible role or playboox.yml you want to test
        #   Some Examples:
        #   targets: "role/my_role/"
        #   targets: "site.yml"
        #
        # group: ""
        #  [optional]
        #   When testing playbooks you have to tell ansible
        #   the group you that we write in our hosts file.
        #   example:
        #   group: 'servers'
        #
        # hosts: ""
        #  [optional]
        #   When testing playbooks you have to give one example
        #   host this action should use to test your playbook.
        #   > We only spawn one docker container that mean
        #   > we can only test one host at the time. Sorry
        #   some examples:
        #   hosts: 'localhost'
        #   hosts: 'srv01.example.com'
        #
        # requirements: ""
        #  [optional]
        #   When testing playbooks and you are using ansible galaxy,
        #   you may be interested in installing your requirements
        #   from ansible galaxy.
        #   To do this please provide us either the role name directly
        #   requirements: 'do1jlr.ansible_version'
        #   or your requiements.yml file.
        #   requirements: 'requirements.yml'

Alternatively, you can run the ansible check only on certain branches:

on:
  push:
    branches:
    - stable
    - release/v*

or on various events


Contributing

If you are missing a feature or see a bug. Please report it. Or - if you like - open a pull-request.

License

The Dockerfile and associated scripts and documentation in this project are released under the MIT License.

Credits

The initial GitHub action has been created by Stefan Stölzle at stoe/actions.
It was used by ansible for lint checks at ansible/ansible-lint-action
It was modified from L3D to check ansible roles and playbooks.