Compare commits

...

23 Commits

Author SHA1 Message Date
Jeff Geerling 8c85339f21 A wee bit of modernization. 2024-01-24 21:59:18 -06:00
Jeff Geerling 470ad53d13 Make local dev with molecule a little easier. 2024-01-24 21:47:54 -06:00
Jeff Geerling e9a19b1a79 Stale bot is now Stale GitHub Action. 2023-07-10 17:47:23 -05:00
Jeff Geerling e33397b43a Remove official support for RHEL. Rocky/Alma/Stream support is best-effort. 2023-06-23 10:55:50 -05:00
Jeff Geerling b1d2710661 Get test working maybe again. 2023-04-27 15:06:46 -05:00
Jeff Geerling 8a145319a3 Get test working maybe. 2023-04-27 14:57:38 -05:00
Steve Jorgensen ac2fc8372c
Fixes for epel repo name, and allow to specify a pip executable name (#25)
* Fixes for epel repo name, and allow to specify a pip executable name

* Renamed ansible_epel_name to ansible_epel_repo_name

---------

Co-authored-by: Steven Jorgensen <sjorgen@sandia.gov>
2023-04-27 14:19:21 -05:00
Jeff Geerling e01427a892 Fix Molecule CI workflow since docker plugin has moved. 2023-04-20 17:26:58 -05:00
Morgan Lindqvist e96ad2577f
Optional extra arguments for pip install (#24)
Change-Id: I80a2081962d0636400492c99973aff69d28955e5

Co-authored-by: Morgan Lindqvist <Morgan@quzed.com>
2022-12-10 15:35:30 -06:00
Jeff Geerling 4ac86968ff Fix Molecule CI workflow for Ubuntu 22.04 GitHub Actions. 2022-12-06 18:23:26 -06:00
Jeff Geerling d9d3fe3f39 Add role_name_check skipping to all molecule test suites. 2022-06-01 22:20:23 -05:00
Jeff Geerling ebb6b438ab Update release workflow for more consistency. 2021-12-27 11:34:38 -06:00
Jeff Geerling 4682745d1b Make sure bugs aren't automatically closed. 2021-08-23 08:52:45 -05:00
Jeff Geerling e621f3b2f7 Issue #18: Test build on Ubuntu 20.04 in CI now. 2021-05-06 17:09:11 -05:00
Jeff Geerling 875a8f93b2 Switch from testing on CentOS 8 to Rocky Linux 8. 2021-05-05 14:43:46 -05:00
Jeff Geerling 53b364606d Bump Fedora test version to 33. 2021-04-27 21:01:11 -05:00
Jeff Geerling 25d8f5fc04 Add role-name back in for dashed roles since Galaxy bug fixed. 2021-03-15 09:26:36 -05:00
Jeff Geerling 94b3532fb4 Make ansible-lint work again. 2021-02-22 16:12:10 -06:00
Jeff Geerling adf22d8c73 Dump Travis CI and move to GitHub Actions. 2020-11-04 22:52:55 -06:00
Jeff Geerling 35546b1505 Switch to travis-ci.com. 2020-10-26 20:08:18 -05:00
Jeff Geerling ba22aaeb41 Make sure docker driver is installed with molecule. 2020-10-15 17:01:52 -05:00
Jeff Geerling 409ec4b75a Ignore the tyranny of ansible-lint rule 106. 2020-08-20 19:18:53 -05:00
Jeff Geerling d600480d49 Upgrade Travis CI docker version to fix Molecule tests. 2020-08-12 14:51:55 -05:00
15 changed files with 195 additions and 103 deletions

3
.ansible-lint Normal file
View File

@ -0,0 +1,3 @@
skip_list:
- 'yaml'
- 'role-name'

56
.github/stale.yml vendored
View File

@ -1,56 +0,0 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 90
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: 30
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
onlyLabels: []
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- pinned
- security
- planned
# Set to true to ignore issues in a project (defaults to false)
exemptProjects: false
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: false
# Set to true to ignore issues with an assignee (defaults to false)
exemptAssignees: false
# Label to use when marking as stale
staleLabel: stale
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 30
pulls:
markComment: |-
This pull request has been marked 'stale' due to lack of recent activity. If there is no further activity, the PR will be closed in another 30 days. Thank you for your contribution!
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark pull requests as stale.
unmarkComment: >-
This pull request is no longer marked for closure.
closeComment: >-
This pull request has been closed due to inactivity. If you feel this is in error, please reopen the pull request or file a new PR with the relevant details.
issues:
markComment: |-
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark issues as stale.
unmarkComment: >-
This issue is no longer marked for closure.
closeComment: >-
This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

75
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,75 @@
---
name: CI
'on':
pull_request:
push:
branches:
- master
schedule:
- cron: "30 5 * * 0"
defaults:
run:
working-directory: 'geerlingguy.ansible'
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v4
with:
path: 'geerlingguy.ansible'
- name: Set up Python 3.
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install test dependencies.
run: pip3 install yamllint
- name: Lint code.
run: |
yamllint .
molecule:
name: Molecule
runs-on: ubuntu-latest
strategy:
matrix:
include:
- distro: rockylinux9
playbook: converge.yml
- distro: fedora39
playbook: converge.yml
- distro: ubuntu2204
playbook: converge.yml
- distro: debian12
playbook: converge.yml
- distro: rockylinux8
playbook: pip.yml
steps:
- name: Check out the codebase.
uses: actions/checkout@v4
with:
path: 'geerlingguy.ansible'
- name: Set up Python 3.
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install test dependencies.
run: pip3 install ansible molecule molecule-plugins[docker] docker
- name: Run Molecule tests.
run: molecule test
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
MOLECULE_DISTRO: ${{ matrix.distro }}
MOLECULE_PLAYBOOK: ${{ matrix.playbook }}

40
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,40 @@
---
# This workflow requires a GALAXY_API_KEY secret present in the GitHub
# repository or organization.
#
# See: https://github.com/marketplace/actions/publish-ansible-role-to-galaxy
# See: https://github.com/ansible/galaxy/issues/46
name: Release
'on':
push:
tags:
- '*'
defaults:
run:
working-directory: 'geerlingguy.ansible'
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v4
with:
path: 'geerlingguy.ansible'
- name: Set up Python 3.
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Ansible.
run: pip3 install ansible-core
- name: Trigger a new import on Galaxy.
run: >-
ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }}
$(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2)

34
.github/workflows/stale.yml vendored Normal file
View File

@ -0,0 +1,34 @@
---
name: Close inactive issues
'on':
schedule:
- cron: "55 19 * * 1" # semi-random time
jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v8
with:
days-before-stale: 120
days-before-close: 60
exempt-issue-labels: bug,pinned,security,planned
exempt-pr-labels: bug,pinned,security,planned
stale-issue-label: "stale"
stale-pr-label: "stale"
stale-issue-message: |
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark issues as stale.
close-issue-message: |
This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.
stale-pr-message: |
This pr has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark issues as stale.
close-pr-message: |
This pr has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.
repo-token: ${{ secrets.GITHUB_TOKEN }}

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
*.retry
*/__pycache__
*.pyc
.cache

View File

@ -1,34 +0,0 @@
---
language: python
services: docker
env:
global:
- ROLE_NAME: ansible
matrix:
- MOLECULE_DISTRO: centos8
- MOLECULE_DISTRO: fedora32
# See: https://github.com/geerlingguy/ansible-role-ansible/issues/18
# - MOLECULE_DISTRO: ubuntu2004
- MOLECULE_DISTRO: ubuntu1804
- MOLECULE_DISTRO: debian10
- MOLECULE_DISTRO: centos8
MOLECULE_PLAYBOOK: playbook-pip.yml
install:
# Install test dependencies.
- pip install molecule yamllint ansible-lint docker
before_script:
# Use actual Ansible Galaxy role name for the project directory.
- cd ../
- mv ansible-role-$ROLE_NAME geerlingguy.$ROLE_NAME
- cd geerlingguy.$ROLE_NAME
script:
# Run tests.
- molecule test
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

View File

@ -1,6 +1,10 @@
---
extends: default
rules:
line-length:
max: 120
level: warning
ignore: |
.github/workflows/stale.yml

View File

@ -1,12 +1,12 @@
# Ansible Role: Ansible
[![Build Status](https://travis-ci.org/geerlingguy/ansible-role-ansible.svg?branch=master)](https://travis-ci.org/geerlingguy/ansible-role-ansible)
[![CI](https://github.com/geerlingguy/ansible-role-ansible/workflows/CI/badge.svg?event=push)](https://github.com/geerlingguy/ansible-role-ansible/actions?query=workflow%3ACI)
An Ansible Role that installs Ansible on Linux servers.
## Requirements
If using on a RedHat/CentOS-based host, make sure you've added the EPEL repository (it can easily be installed by including the `geerlingguy.repo-epel` role on Ansible Galaxy).
If using on a RedHat/CentOS/Rocky Linux-based host, make sure you've added the EPEL repository (it can easily be installed by including the `geerlingguy.repo-epel` role on Ansible Galaxy).
## Role Variables
@ -20,6 +20,19 @@ Whether to install Ansible via the system `package` manager (`apt`, `yum`, `dnf`
If `ansible_install_method` is set to `pip`, the specific Ansible version to be installed via Pip. If not set, the latest version of Ansible will be installed.
ansible_install_pip_extra_args: ''
If `ansible_install_method` is set to `pip`, the extra arguments to be given to `pip` are listed here. If not set, no extra arguments are given.
ansible_pip_executable: ''
if `ansible_install_method` is set to `pip`, this is the path to the pip executable, in case your platform doesn't find the right name.
ansible_epel_repo_name: 'epel'
if `ansible_install_method` is set to `package` and you are on a RHEL machine, and your local satellite server admins decided to name the epel repository something other than epel, this variable gives you the opportunity to provide the right name.
## Dependencies
None.
@ -38,6 +51,7 @@ Install from pip:
vars:
ansible_install_method: pip
ansible_install_version_pip: "2.7.0"
ansible_install_pip_extra_args: "--user"
roles:
- role: geerlingguy.pip
- role: geerlingguy.ansible

View File

@ -6,3 +6,12 @@ ansible_install_method: package
# Used only if ansible_install_method is 'pip'. If empty, defaults to latest.
ansible_install_version_pip: ''
# Which extra arguments should be gived to pip
ansible_install_pip_extra_args: ''
# path to pip executable to use
ansible_pip_executable: ''
# name of epel repo if it isn't standard
ansible_epel_repo_name: 'epel'

View File

@ -6,11 +6,8 @@ galaxy_info:
description: Ansible for RedHat/CentOS/Debian/Ubuntu.
company: "Midwestern Mac, LLC"
license: "license (BSD, MIT)"
min_ansible_version: 2.4
min_ansible_version: 2.10
platforms:
- name: EL
versions:
- all
- name: Fedora
versions:
- all

View File

@ -1,18 +1,18 @@
---
role_name_check: 1
dependency:
name: galaxy
options:
ignore-errors: true
driver:
name: docker
lint: |
set -e
yamllint .
ansible-lint
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
image: "geerlingguy/docker-${MOLECULE_DISTRO:-rockylinux8}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
pre_build_image: true
provisioner:

View File

@ -5,7 +5,9 @@
vars:
ansible_install_method: pip
ansible_pip_executable: pip3
ansible_install_version_pip: "2.6.2"
ansible_install_pip_extra_args: "--user"
roles:
- role: geerlingguy.pip

View File

@ -3,4 +3,4 @@
package:
name: ansible
state: "{{ ansible_package_state }}"
enablerepo: epel
enablerepo: "{{ ansible_epel_repo_name }}"

View File

@ -2,4 +2,6 @@
- name: Install Ansible via Pip.
pip:
name: ansible
executable: "{{ ansible_pip_executable | default(omit) }}"
version: "{{ ansible_install_version_pip | default(omit) }}"
extra_args: "{{ ansible_install_pip_extra_args | default(omit) }}"