diff --git a/.github/workflows/molecule-test.yml b/.github/workflows/molecule-test.yml new file mode 100644 index 0000000..09ea701 --- /dev/null +++ b/.github/workflows/molecule-test.yml @@ -0,0 +1,29 @@ +--- +name: Molecule Test +on: [push, pull_request] +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + max-parallel: 4 + matrix: + molecule_distro: ['centos7', 'centos8', 'ubuntu1804', 'ubuntu2004'] + env: + ANSIBLE_CALLBACK_WHITELIST: profile_tasks + + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3 + uses: actions/setup-python@v1 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install ansible-lint flake8 molecule docker + - name: Test with molecule + run: | + molecule test --all + env: + MOLECULE_DISTRO: ${{ matrix.molecule_distro }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3a650ad..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -language: python -services: docker - -env: - matrix: - # Test defaults. - - MOLECULE_DISTRO: centos7 - - MOLECULE_DISTRO: ubuntu1804 - -install: - # Install test dependencies. - - pip install molecule docker - -script: - # Run tests. - - molecule test --all - -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/README.md b/README.md index 0df895e..02a6b83 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ are not present in the list of Ansible facts, like the container's private ip ad Requirements ------------ -None. Tested on CentOS 7 and Ubuntu 18.04. +None. Tested on CentOS 7 & 8 and Ubuntu 18.04 & 20.04. Role Variables -------------- diff --git a/meta/main.yml b/meta/main.yml index a6adeea..1497047 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,5 +1,6 @@ --- galaxy_info: + role_name: facter author: Kevin Coakley description: Install Facter on a host then regather the host facts @@ -25,9 +26,11 @@ galaxy_info: - name: EL versions: - 7 + - 8 - name: Ubuntu versions: - bionic + - focal galaxy_tags: - system diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 2ca6fea..7481fd7 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -3,10 +3,11 @@ dependency: name: galaxy driver: name: docker -lint: - name: yamllint - options: - config-file: molecule/default/yaml-lint.yml +lint: | + set -e + yamllint -c molecule/yaml-lint.yml . + ansible-lint + flake8 platforms: - name: instance image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest" diff --git a/molecule/default/yaml-lint.yml b/molecule/yaml-lint.yml similarity index 100% rename from molecule/default/yaml-lint.yml rename to molecule/yaml-lint.yml diff --git a/tasks/main.yml b/tasks/main.yml index d33be4c..1fbd1e0 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -11,6 +11,11 @@ state: present when: ansible_os_family == "RedHat" +- name: Run "apt-get update" (Debian) + apt: + update_cache: true + when: ansible_os_family == "Debian" + - name: Download and install Ruby (Debian) package: name: ruby