Compare commits
23 Commits
Author | SHA1 | Date |
---|---|---|
Jeff Geerling | 8c85339f21 | |
Jeff Geerling | 470ad53d13 | |
Jeff Geerling | e9a19b1a79 | |
Jeff Geerling | e33397b43a | |
Jeff Geerling | b1d2710661 | |
Jeff Geerling | 8a145319a3 | |
Steve Jorgensen | ac2fc8372c | |
Jeff Geerling | e01427a892 | |
Morgan Lindqvist | e96ad2577f | |
Jeff Geerling | 4ac86968ff | |
Jeff Geerling | d9d3fe3f39 | |
Jeff Geerling | ebb6b438ab | |
Jeff Geerling | 4682745d1b | |
Jeff Geerling | e621f3b2f7 | |
Jeff Geerling | 875a8f93b2 | |
Jeff Geerling | 53b364606d | |
Jeff Geerling | 25d8f5fc04 | |
Jeff Geerling | 94b3532fb4 | |
Jeff Geerling | adf22d8c73 | |
Jeff Geerling | 35546b1505 | |
Jeff Geerling | ba22aaeb41 | |
Jeff Geerling | 409ec4b75a | |
Jeff Geerling | d600480d49 |
|
@ -0,0 +1,3 @@
|
|||
skip_list:
|
||||
- 'yaml'
|
||||
- 'role-name'
|
|
@ -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.
|
|
@ -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 }}
|
|
@ -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)
|
|
@ -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 }}
|
|
@ -1,3 +1,5 @@
|
|||
*.retry
|
||||
*/__pycache__
|
||||
*.pyc
|
||||
.cache
|
||||
|
||||
|
|
34
.travis.yml
34
.travis.yml
|
@ -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/
|
|
@ -1,6 +1,10 @@
|
|||
---
|
||||
extends: default
|
||||
|
||||
rules:
|
||||
line-length:
|
||||
max: 120
|
||||
level: warning
|
||||
|
||||
ignore: |
|
||||
.github/workflows/stale.yml
|
||||
|
|
18
README.md
18
README.md
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
|
@ -3,4 +3,4 @@
|
|||
package:
|
||||
name: ansible
|
||||
state: "{{ ansible_package_state }}"
|
||||
enablerepo: epel
|
||||
enablerepo: "{{ ansible_epel_repo_name }}"
|
||||
|
|
|
@ -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) }}"
|
||||
|
|
Loading…
Reference in New Issue