New role: code.

This commit is contained in:
Robert de Bock 2022-08-03 09:08:50 +02:00
parent fca983cede
commit bed3e93cd6
367 changed files with 2140 additions and 1921 deletions

View File

@ -1,7 +1,7 @@
namespace: "robertdebock"
name: "development_environment"
description: Install everything you need to develop Ansible roles.
version: "2.2.2"
version: "2.2.4"
readme: "README.md"
authors:
- "Robert de Bock"

View File

@ -1,8 +1,8 @@
---
#
# Ansible managed
#
exclude_paths:
- ./meta/exception.yml
- ./meta/preferences.yml
- ./molecule/default/prepare.yml
- ./molecule/default/converge.yml

View File

@ -5,6 +5,7 @@ about: Create a report to help me improve
---
## Describe the bug
A clear and concise description of what the bug is.
## Playbook

View File

@ -13,6 +13,6 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: galaxy
uses: robertdebock/galaxy-action@1.1.0
uses: robertdebock/galaxy-action@1.2.0
with:
galaxy_api_key: ${{ secrets.galaxy_api_key }}

View File

@ -22,7 +22,7 @@ jobs:
with:
path: "${{ github.repository }}"
- name: molecule
uses: robertdebock/molecule-action@2.6.16
uses: robertdebock/molecule-action@4.0.7
with:
command: lint
test:
@ -35,20 +35,24 @@ jobs:
config:
- image: "alpine"
tag: "latest"
- image: "centos"
- image: "enterpriselinux"
tag: "latest"
- image: "debian"
tag: "latest"
- image: "debian"
tag: "bullseye"
tag: "bookworm"
- image: "fedora"
tag: "32"
tag: "35"
- image: "fedora"
tag: "latest"
- image: "fedora"
tag: "rawhide"
- image: "opensuse"
tag: "latest"
- image: "ubuntu"
tag: "latest"
- image: "ubuntu"
tag: "focal"
- image: "ubuntu"
tag: "bionic"
steps:
@ -61,7 +65,7 @@ jobs:
- name: parse apparmor for mysql
run: sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
- name: molecule
uses: robertdebock/molecule-action@2.6.16
uses: robertdebock/molecule-action@4.0.7
with:
image: ${{ matrix.config.image }}
tag: ${{ matrix.config.tag }}

View File

@ -3,3 +3,4 @@
*.swp
.tox
.cache
.DS_Store

View File

@ -1,30 +0,0 @@
---
#
# Ansible managed
#
language: python
os: linux
dist: xenial
python:
- "3.9"
services:
- docker
cache:
- pip
install:
- pip install --upgrade pip
- pip install yamllint
- pip install ansible-lint
script:
- yamllint .
- ansible-lint
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
email: false

View File

@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2021 Robert de Bock (robert@meinit.nl)
Copyright 2022 Robert de Bock (robert@meinit.nl)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@ -8,7 +8,7 @@ Install and configure ansible on your system.
## [Example Playbook](#example-playbook)
This example is taken from `molecule/resources/converge.yml` and is tested on each push, pull request and release.
This example is taken from `molecule/default/converge.yml` and is tested on each push, pull request and release.
```yaml
---
- name: Converge
@ -20,7 +20,7 @@ This example is taken from `molecule/resources/converge.yml` and is tested on ea
- role: robertdebock.ansible
```
The machine needs to be prepared in CI this is done using `molecule/resources/prepare.yml`:
The machine needs to be prepared. In CI this is done using `molecule/default/prepare.yml`:
```yaml
---
- name: Prepare
@ -39,7 +39,7 @@ Also see a [full explanation and example](https://robertdebock.nl/how-to-use-the
## [Role Variables](#role-variables)
These variables are set in `defaults/main.yml`:
The default values for the variables are set in `defaults/main.yml`:
```yaml
---
# defaults file for ansible
@ -61,16 +61,16 @@ ansible_configuration:
- pip packages listed in [requirements.txt](https://github.com/robertdebock/ansible-role-ansible/blob/master/requirements.txt).
## [Status of requirements](#status-of-requirements)
## [Status of used roles](#status-of-requirements)
The following roles are used to prepare a system. You may choose to prepare your system in another way, I have tested these roles as well.
The following roles are used to prepare a system. You can prepare your system in another way.
| Requirement | GitHub | GitLab |
|-------------|--------|--------|
| [robertdebock.bootstrap](https://galaxy.ansible.com/robertdebock/bootstrap) | [![Build Status GitHub](https://github.com/robertdebock/ansible-role-bootstrap/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-bootstrap/actions) | [![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-ansible-role-bootstrap/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-bootstrap)
| [robertdebock.buildtools](https://galaxy.ansible.com/robertdebock/buildtools) | [![Build Status GitHub](https://github.com/robertdebock/ansible-role-buildtools/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-buildtools/actions) | [![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-ansible-role-buildtools/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-buildtools)
| [robertdebock.epel](https://galaxy.ansible.com/robertdebock/epel) | [![Build Status GitHub](https://github.com/robertdebock/ansible-role-epel/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-epel/actions) | [![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-ansible-role-epel/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-epel)
| [robertdebock.python_pip](https://galaxy.ansible.com/robertdebock/python_pip) | [![Build Status GitHub](https://github.com/robertdebock/ansible-role-python_pip/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-python_pip/actions) | [![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-ansible-role-python_pip/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-python_pip)
|[robertdebock.bootstrap](https://galaxy.ansible.com/robertdebock/bootstrap)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-bootstrap/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-bootstrap/actions)|[![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-bootstrap/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-bootstrap)|
|[robertdebock.buildtools](https://galaxy.ansible.com/robertdebock/buildtools)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-buildtools/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-buildtools/actions)|[![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-buildtools/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-buildtools)|
|[robertdebock.epel](https://galaxy.ansible.com/robertdebock/epel)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-epel/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-epel/actions)|[![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-epel/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-epel)|
|[robertdebock.python_pip](https://galaxy.ansible.com/robertdebock/python_pip)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-python_pip/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-python_pip/actions)|[![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-python_pip/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-python_pip)|
## [Context](#context)
@ -87,10 +87,10 @@ This role has been tested on these [container images](https://hub.docker.com/u/r
|---------|----|
|alpine|all|
|el|8|
|debian|buster, bullseye|
|debian|all|
|fedora|all|
|opensuse|all|
|ubuntu|focal, bionic|
|ubuntu|all|
The minimum version of Ansible required is 2.10, tests have been done to:
@ -98,14 +98,6 @@ The minimum version of Ansible required is 2.10, tests have been done to:
- The current version.
- The development version.
## [Exceptions](#exceptions)
Some variarations of the build matrix do not work. These are the variations and reasons why the build won't work:
| variation | reason |
|---------------------------|------------------------|
| amazonlinux:1 | No package matching 'python3-pip' |
If you find issues, please register them in [GitHub](https://github.com/robertdebock/ansible-role-ansible/issues)
@ -113,7 +105,6 @@ If you find issues, please register them in [GitHub](https://github.com/robertde
Apache-2.0
## [Author Information](#author-information)
[Robert de Bock](https://robertdebock.nl/)

View File

@ -1,2 +1,2 @@
install_date: Sun Mar 21 06:59:14 2021
version: 3.0.2
install_date: Wed Aug 3 07:06:57 2022
version: 3.1.4

View File

@ -1,4 +0,0 @@
---
exceptions:
- variation: amazonlinux:1
reason: "No package matching 'python3-pip'"

View File

@ -1,6 +1,7 @@
---
galaxy_info:
author: Robert de Bock
namespace: robertdebock
role_name: ansible
description: Install and configure ansible on your system.
license: Apache-2.0
@ -16,8 +17,7 @@ galaxy_info:
- 8
- name: Debian
versions:
- buster
- bullseye
- all
- name: Fedora
versions:
- all
@ -26,8 +26,7 @@ galaxy_info:
- all
- name: Ubuntu
versions:
- focal
- bionic
- all
galaxy_tags:
- ansible

View File

@ -23,9 +23,5 @@ platforms:
pre_build_image: yes
provisioner:
name: ansible
config_options:
defaults:
stdout_callback: yaml
bin_ansible_callbacks: yes
verifier:
name: ansible

View File

@ -6,6 +6,7 @@
tasks:
- name: run ansible
shell: ansible --version > ansible.version
ansible.builtin.shell:
cmd: ansible --version > ansible.version
args:
creates: ansible.version

View File

@ -1,8 +1,8 @@
---
# tasks file for ansible
- name: include assert.yml
import_tasks: assert.yml
- name: import assert.yml
ansible.builtin.import_tasks: assert.yml
run_once: yes
delegate_to: localhost

View File

@ -3,18 +3,16 @@
#
[tox]
minversion = 3.21.4
# 2.11 has been disabled: couldn't resolve module/action 'docker_container'.
envlist = py{39}-ansible-{2.9,2.10}
envlist = py{310}-ansible-{4,5}
skipsdist = true
[testenv]
deps =
2.9: ansible == 2.9.*
2.10: ansible == 2.10.*
2.11: git+https://github.com/ansible/ansible.git@devel
4: ansible == 4.*
5: ansible == 5.*
molecule[docker]
docker == 4.*
docker == 5.*
ansible-lint == 5.*
commands = molecule test
setenv =
@ -23,4 +21,4 @@ setenv =
ANSIBLE_FORCE_COLOR=1
ANSIBLE_ROLES_PATH=../
passenv = namespace image tag
passenv = namespace image tag DOCKER_HOST

View File

@ -1,8 +1,8 @@
---
#
# Ansible managed
#
exclude_paths:
- ./meta/exception.yml
- ./meta/preferences.yml
- ./molecule/default/prepare.yml
- ./molecule/default/converge.yml

View File

@ -5,6 +5,7 @@ about: Create a report to help me improve
---
## Describe the bug
A clear and concise description of what the bug is.
## Playbook

View File

@ -13,6 +13,6 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: galaxy
uses: robertdebock/galaxy-action@1.1.0
uses: robertdebock/galaxy-action@1.2.0
with:
galaxy_api_key: ${{ secrets.galaxy_api_key }}

View File

@ -22,7 +22,7 @@ jobs:
with:
path: "${{ github.repository }}"
- name: molecule
uses: robertdebock/molecule-action@2.6.16
uses: robertdebock/molecule-action@4.0.7
with:
command: lint
test:
@ -33,18 +33,22 @@ jobs:
fail-fast: false
matrix:
config:
- image: "centos"
- image: "enterpriselinux"
tag: "latest"
- image: "debian"
tag: "latest"
- image: "debian"
tag: "bullseye"
tag: "bookworm"
- image: "fedora"
tag: "32"
tag: "35"
- image: "fedora"
tag: "latest"
- image: "fedora"
tag: "rawhide"
- image: "ubuntu"
tag: "latest"
- image: "ubuntu"
tag: "focal"
- image: "ubuntu"
tag: "bionic"
steps:
@ -57,7 +61,7 @@ jobs:
- name: parse apparmor for mysql
run: sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
- name: molecule
uses: robertdebock/molecule-action@2.6.16
uses: robertdebock/molecule-action@4.0.7
with:
image: ${{ matrix.config.image }}
tag: ${{ matrix.config.tag }}

View File

@ -3,3 +3,4 @@
*.swp
.tox
.cache
.DS_Store

View File

@ -1,30 +0,0 @@
---
#
# Ansible managed
#
language: python
os: linux
dist: xenial
python:
- "3.9"
services:
- docker
cache:
- pip
install:
- pip install --upgrade pip
- pip install yamllint
- pip install ansible-lint
script:
- yamllint .
- ansible-lint
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
email: false

View File

@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2021 Robert de Bock (robert@meinit.nl)
Copyright 2022 Robert de Bock (robert@meinit.nl)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@ -8,7 +8,7 @@ Install ansible-lint on your system.
## [Example Playbook](#example-playbook)
This example is taken from `molecule/resources/converge.yml` and is tested on each push, pull request and release.
This example is taken from `molecule/default/converge.yml` and is tested on each push, pull request and release.
```yaml
---
- name: Converge
@ -20,7 +20,7 @@ This example is taken from `molecule/resources/converge.yml` and is tested on ea
- role: robertdebock.ansible_lint
```
The machine needs to be prepared in CI this is done using `molecule/resources/prepare.yml`:
The machine needs to be prepared. In CI this is done using `molecule/default/prepare.yml`:
```yaml
---
- name: Prepare
@ -42,16 +42,16 @@ Also see a [full explanation and example](https://robertdebock.nl/how-to-use-the
- pip packages listed in [requirements.txt](https://github.com/robertdebock/ansible-role-ansible_lint/blob/master/requirements.txt).
## [Status of requirements](#status-of-requirements)
## [Status of used roles](#status-of-requirements)
The following roles are used to prepare a system. You may choose to prepare your system in another way, I have tested these roles as well.
The following roles are used to prepare a system. You can prepare your system in another way.
| Requirement | GitHub | GitLab |
|-------------|--------|--------|
| [robertdebock.bootstrap](https://galaxy.ansible.com/robertdebock/bootstrap) | [![Build Status GitHub](https://github.com/robertdebock/ansible-role-bootstrap/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-bootstrap/actions) | [![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-ansible-role-bootstrap/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-bootstrap)
| [robertdebock.buildtools](https://galaxy.ansible.com/robertdebock/buildtools) | [![Build Status GitHub](https://github.com/robertdebock/ansible-role-buildtools/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-buildtools/actions) | [![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-ansible-role-buildtools/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-buildtools)
| [robertdebock.epel](https://galaxy.ansible.com/robertdebock/epel) | [![Build Status GitHub](https://github.com/robertdebock/ansible-role-epel/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-epel/actions) | [![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-ansible-role-epel/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-epel)
| [robertdebock.python_pip](https://galaxy.ansible.com/robertdebock/python_pip) | [![Build Status GitHub](https://github.com/robertdebock/ansible-role-python_pip/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-python_pip/actions) | [![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-ansible-role-python_pip/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-python_pip)
|[robertdebock.bootstrap](https://galaxy.ansible.com/robertdebock/bootstrap)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-bootstrap/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-bootstrap/actions)|[![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-bootstrap/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-bootstrap)|
|[robertdebock.buildtools](https://galaxy.ansible.com/robertdebock/buildtools)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-buildtools/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-buildtools/actions)|[![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-buildtools/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-buildtools)|
|[robertdebock.epel](https://galaxy.ansible.com/robertdebock/epel)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-epel/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-epel/actions)|[![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-epel/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-epel)|
|[robertdebock.python_pip](https://galaxy.ansible.com/robertdebock/python_pip)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-python_pip/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-python_pip/actions)|[![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-python_pip/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-python_pip)|
## [Context](#context)
@ -69,7 +69,7 @@ This role has been tested on these [container images](https://hub.docker.com/u/r
|el|8|
|debian|all|
|fedora|all|
|ubuntu|focal, bionic|
|ubuntu|all|
The minimum version of Ansible required is 2.10, tests have been done to:
@ -77,15 +77,6 @@ The minimum version of Ansible required is 2.10, tests have been done to:
- The current version.
- The development version.
## [Exceptions](#exceptions)
Some variarations of the build matrix do not work. These are the variations and reasons why the build won't work:
| variation | reason |
|---------------------------|------------------------|
| amazonlinux:1 | No package matching 'python3-pip' |
| amazonlinux | No module named pkg_resources |
If you find issues, please register them in [GitHub](https://github.com/robertdebock/ansible-role-ansible_lint/issues)
@ -93,7 +84,6 @@ If you find issues, please register them in [GitHub](https://github.com/robertde
Apache-2.0
## [Author Information](#author-information)
[Robert de Bock](https://robertdebock.nl/)

View File

@ -1,2 +1,2 @@
install_date: Sun Mar 21 06:59:18 2021
version: 3.0.1
install_date: Wed Aug 3 07:06:59 2022
version: 3.1.2

View File

@ -1,6 +0,0 @@
---
exceptions:
- variation: amazonlinux:1
reason: "No package matching 'python3-pip'"
- variation: amazonlinux
reason: "No module named pkg_resources"

View File

@ -1,6 +1,7 @@
---
galaxy_info:
author: Robert de Bock
namespace: robertdebock
role_name: ansible_lint
description: Install ansible-lint on your system.
license: Apache-2.0
@ -19,8 +20,7 @@ galaxy_info:
- all
- name: Ubuntu
versions:
- focal
- bionic
- all
galaxy_tags:
- ansiblelint

View File

@ -6,6 +6,7 @@ dependency:
name: galaxy
options:
role-file: requirements.yml
requirements-file: requirements.yml
lint: |
set -e
yamllint .
@ -13,7 +14,7 @@ lint: |
driver:
name: docker
platforms:
- name: "ansible_lint-${image:-fedora}-${tag:-latest}${TOX_ENVNAME}"
- name: "ansiblelint-${image:-fedora}-${tag:-latest}${TOX_ENVNAME}"
image: "${namespace:-robertdebock}/${image:-fedora}:${tag:-latest}"
command: /sbin/init
volumes:
@ -22,9 +23,5 @@ platforms:
pre_build_image: yes
provisioner:
name: ansible
config_options:
defaults:
stdout_callback: yaml
bin_ansible_callbacks: yes
verifier:
name: ansible

View File

@ -6,4 +6,4 @@
tasks:
- name: check if connection still works
ping:
ansible.builtin.ping:

View File

@ -4,3 +4,4 @@ roles:
- name: robertdebock.buildtools
- name: robertdebock.epel
- name: robertdebock.python_pip
collections:

View File

@ -3,18 +3,16 @@
#
[tox]
minversion = 3.21.4
# 2.11 has been disabled: couldn't resolve module/action 'docker_container'.
envlist = py{39}-ansible-{2.9,2.10}
envlist = py{310}-ansible-{4,5}
skipsdist = true
[testenv]
deps =
2.9: ansible == 2.9.*
2.10: ansible == 2.10.*
2.11: git+https://github.com/ansible/ansible.git@devel
4: ansible == 4.*
5: ansible == 5.*
molecule[docker]
docker == 4.*
docker == 5.*
ansible-lint == 5.*
commands = molecule test
setenv =
@ -23,4 +21,4 @@ setenv =
ANSIBLE_FORCE_COLOR=1
ANSIBLE_ROLES_PATH=../
passenv = namespace image tag
passenv = namespace image tag DOCKER_HOST

View File

@ -1,3 +1,4 @@
---
#
# Ansible managed
#

View File

@ -5,6 +5,7 @@ about: Create a report to help me improve
---
## Describe the bug
A clear and concise description of what the bug is.
## Playbook

View File

@ -22,7 +22,7 @@ jobs:
with:
path: "${{ github.repository }}"
- name: molecule
uses: robertdebock/molecule-action@2.6.16
uses: robertdebock/molecule-action@2.7.2
with:
command: lint
test:
@ -33,16 +33,18 @@ jobs:
fail-fast: false
matrix:
config:
- image: "centos"
- image: "enterpriselinux"
tag: "latest"
- image: "debian"
tag: "latest"
- image: "debian"
tag: "bullseye"
tag: "bookworm"
- image: "fedora"
tag: "32"
tag: "34"
- image: "fedora"
tag: "latest"
- image: "fedora"
tag: "rawhide"
- image: "ubuntu"
tag: "bionic"
steps:
@ -55,7 +57,7 @@ jobs:
- name: parse apparmor for mysql
run: sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
- name: molecule
uses: robertdebock/molecule-action@2.6.16
uses: robertdebock/molecule-action@2.7.2
with:
image: ${{ matrix.config.image }}
tag: ${{ matrix.config.tag }}

View File

@ -3,3 +3,4 @@
*.swp
.tox
.cache
.DS_Store

View File

@ -18,8 +18,7 @@ cache:
install:
- pip install --upgrade pip
- pip install yamllint
- pip install ansible-lint
- pip install ansible ansible-lint yamllint
script:
- yamllint .

View File

@ -8,7 +8,7 @@ Install and configure ara on your system.
## [Example Playbook](#example-playbook)
This example is taken from `molecule/resources/converge.yml` and is tested on each push, pull request and release.
This example is taken from `molecule/default/converge.yml` and is tested on each push, pull request and release.
```yaml
---
- name: Converge
@ -20,7 +20,7 @@ This example is taken from `molecule/resources/converge.yml` and is tested on ea
- role: robertdebock.ara
```
The machine needs to be prepared in CI this is done using `molecule/resources/prepare.yml`:
The machine needs to be prepared. In CI this is done using `molecule/default/prepare.yml`:
```yaml
---
- name: Prepare
@ -39,7 +39,7 @@ Also see a [full explanation and example](https://robertdebock.nl/how-to-use-the
## [Role Variables](#role-variables)
These variables are set in `defaults/main.yml`:
The default values for the variables are set in `defaults/main.yml`:
```yaml
---
# defaults file for ara
@ -66,17 +66,17 @@ ara_user: root
- pip packages listed in [requirements.txt](https://github.com/robertdebock/ansible-role-ara/blob/master/requirements.txt).
## [Status of requirements](#status-of-requirements)
## [Status of used roles](#status-of-requirements)
The following roles are used to prepare a system. You may choose to prepare your system in another way, I have tested these roles as well.
The following roles are used to prepare a system. You can prepare your system in another way.
| Requirement | GitHub | GitLab |
|-------------|--------|--------|
| [robertdebock.bootstrap](https://galaxy.ansible.com/robertdebock/bootstrap) | [![Build Status GitHub](https://github.com/robertdebock/ansible-role-bootstrap/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-bootstrap/actions) | [![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-ansible-role-bootstrap/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-bootstrap)
| [robertdebock.buildtools](https://galaxy.ansible.com/robertdebock/buildtools) | [![Build Status GitHub](https://github.com/robertdebock/ansible-role-buildtools/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-buildtools/actions) | [![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-ansible-role-buildtools/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-buildtools)
| [robertdebock.epel](https://galaxy.ansible.com/robertdebock/epel) | [![Build Status GitHub](https://github.com/robertdebock/ansible-role-epel/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-epel/actions) | [![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-ansible-role-epel/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-epel)
| [robertdebock.python_pip](https://galaxy.ansible.com/robertdebock/python_pip) | [![Build Status GitHub](https://github.com/robertdebock/ansible-role-python_pip/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-python_pip/actions) | [![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-ansible-role-python_pip/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-python_pip)
| [robertdebock.service](https://galaxy.ansible.com/robertdebock/service) | [![Build Status GitHub](https://github.com/robertdebock/ansible-role-service/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-service/actions) | [![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-ansible-role-service/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-service)
|[robertdebock.bootstrap](https://galaxy.ansible.com/robertdebock/bootstrap)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-bootstrap/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-bootstrap/actions)|[![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-bootstrap/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-bootstrap)|
|[robertdebock.buildtools](https://galaxy.ansible.com/robertdebock/buildtools)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-buildtools/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-buildtools/actions)|[![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-buildtools/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-buildtools)|
|[robertdebock.epel](https://galaxy.ansible.com/robertdebock/epel)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-epel/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-epel/actions)|[![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-epel/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-epel)|
|[robertdebock.python_pip](https://galaxy.ansible.com/robertdebock/python_pip)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-python_pip/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-python_pip/actions)|[![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-python_pip/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-python_pip)|
|[robertdebock.service](https://galaxy.ansible.com/robertdebock/service)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-service/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-service/actions)|[![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-service/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-service)|
## [Context](#context)
@ -92,7 +92,7 @@ This role has been tested on these [container images](https://hub.docker.com/u/r
|container|tags|
|---------|----|
|el|8|
|debian|buster, bullseye|
|debian|all|
|fedora|all|
|ubuntu|bionic|
@ -104,7 +104,7 @@ The minimum version of Ansible required is 2.10, tests have been done to:
## [Exceptions](#exceptions)
Some variarations of the build matrix do not work. These are the variations and reasons why the build won't work:
Some roles can't run on a specific distribution or version. Here are some exceptions.
| variation | reason |
|---------------------------|------------------------|
@ -120,7 +120,6 @@ If you find issues, please register them in [GitHub](https://github.com/robertde
Apache-2.0
## [Author Information](#author-information)
[Robert de Bock](https://robertdebock.nl/)

View File

@ -6,6 +6,7 @@
name: ara
state: restarted
become: yes
become_user: root
when:
- not ansible_check_mode | bool
@ -13,5 +14,6 @@
ansible.builtin.systemd:
daemon_reload: yes
become: yes
become_user: root
notify:
- restart ara

View File

@ -1,2 +1,2 @@
install_date: Sun Mar 21 06:59:21 2021
version: 3.0.3
install_date: Wed Aug 3 07:07:01 2022
version: 3.1.1

View File

@ -1,6 +1,7 @@
---
galaxy_info:
author: Robert de Bock
namespace: robertdebock
role_name: ara
description: Install and configure ara on your system.
license: Apache-2.0
@ -13,8 +14,7 @@ galaxy_info:
- 8
- name: Debian
versions:
- buster
- bullseye
- all
- name: Fedora
versions:
- all

View File

@ -6,11 +6,11 @@ dependency:
name: galaxy
options:
role-file: requirements.yml
requirements-file: requirements.yml
lint: |
set -e
yamllint .
ansible-lint
ansible-later
driver:
name: docker
platforms:
@ -23,9 +23,5 @@ platforms:
pre_build_image: yes
provisioner:
name: ansible
config_options:
defaults:
stdout_callback: yaml
bin_ansible_callbacks: yes
verifier:
name: ansible

View File

@ -6,4 +6,4 @@
tasks:
- name: check if connection still works
ping:
ansible.builtin.ping:

View File

@ -1,8 +1,8 @@
---
# tasks file for ara
- name: include assert.yml
import_tasks: assert.yml
- name: import assert.yml
ansible.builtin.import_tasks: assert.yml
run_once: yes
delegate_to: localhost
@ -24,11 +24,11 @@
- name: find callback_plugins path
block:
- name: try python2
ansible.builtin.command: "{{ ara_setup_command_python2 }}"
ansible.builtin.command:
cmd: "{{ ara_setup_command_python2 }}"
register: ara_callback_plugins
changed_when: no
check_mode: no
rescue:
- name: try python3
ansible.builtin.command: "{{ ara_setup_command_python3 }}"

View File

@ -3,16 +3,15 @@
#
[tox]
minversion = 3.21.4
# 2.11 has been disabled: couldn't resolve module/action 'docker_container'.
envlist = py{39}-ansible-{2.9,2.10}
envlist = py{39}-ansible-{2.9,2.10,2.11}
skipsdist = true
[testenv]
deps =
2.9: ansible == 2.9.*
2.10: ansible == 2.10.*
2.11: git+https://github.com/ansible/ansible.git@devel
2.10: ansible-base == 2.10.*
2.11: ansible-core == 2.11.*
molecule[docker]
docker == 4.*
ansible-lint == 5.*
@ -23,4 +22,4 @@ setenv =
ANSIBLE_FORCE_COLOR=1
ANSIBLE_ROLES_PATH=../
passenv = namespace image tag
passenv = namespace image tag DOCKER_HOST

View File

@ -4,9 +4,10 @@
_ara_binary_location:
default: /usr/bin
Debian: /usr/local/bin
RedHat: /usr/local/bin
RedHat: &redhat_binary_location /usr/local/bin
Rocky: *redhat_binary_location
ara_binary_location: "{{ _ara_binary_location[ansible_os_family] | default(_ara_binary_location['default']) }}"
ara_binary_location: "{{ _ara_binary_location[ansible_os_family] | default(_ara_binary_location['default'] ) }}"
ara_setup_command_python2: python -m ara.setup.callback_plugins
ara_setup_command_python3: python3 -m ara.setup.callback_plugins

View File

@ -1,3 +1,4 @@
---
#
# Ansible managed
#

View File

@ -5,6 +5,7 @@ about: Create a report to help me improve
---
## Describe the bug
A clear and concise description of what the bug is.
## Playbook

View File

@ -22,7 +22,7 @@ jobs:
with:
path: "${{ github.repository }}"
- name: molecule
uses: robertdebock/molecule-action@2.6.16
uses: robertdebock/molecule-action@2.7.2
with:
command: lint
test:
@ -33,16 +33,18 @@ jobs:
fail-fast: false
matrix:
config:
- image: "centos"
- image: "enterpriselinux"
tag: "latest"
- image: "debian"
tag: "latest"
- image: "debian"
tag: "bookworm"
- image: "fedora"
tag: "32"
tag: "34"
- image: "fedora"
tag: "latest"
- image: "opensuse"
tag: "latest"
- image: "fedora"
tag: "rawhide"
- image: "ubuntu"
tag: "latest"
- image: "ubuntu"
@ -57,7 +59,7 @@ jobs:
- name: parse apparmor for mysql
run: sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
- name: molecule
uses: robertdebock/molecule-action@2.6.16
uses: robertdebock/molecule-action@2.7.2
with:
image: ${{ matrix.config.image }}
tag: ${{ matrix.config.tag }}

View File

@ -3,3 +3,4 @@
*.swp
.tox
.cache
.DS_Store

View File

@ -18,8 +18,7 @@ cache:
install:
- pip install --upgrade pip
- pip install yamllint
- pip install ansible-lint
- pip install ansible ansible-lint yamllint
script:
- yamllint .

View File

@ -8,7 +8,7 @@ Install atom on your system.
## [Example Playbook](#example-playbook)
This example is taken from `molecule/resources/converge.yml` and is tested on each push, pull request and release.
This example is taken from `molecule/default/converge.yml` and is tested on each push, pull request and release.
```yaml
---
- name: Converge
@ -20,7 +20,7 @@ This example is taken from `molecule/resources/converge.yml` and is tested on ea
- role: robertdebock.atom
```
The machine needs to be prepared in CI this is done using `molecule/resources/prepare.yml`:
The machine needs to be prepared. In CI this is done using `molecule/default/prepare.yml`:
```yaml
---
- name: Prepare
@ -36,7 +36,7 @@ Also see a [full explanation and example](https://robertdebock.nl/how-to-use-the
## [Role Variables](#role-variables)
These variables are set in `defaults/main.yml`:
The default values for the variables are set in `defaults/main.yml`:
```yaml
---
# defaults file for atom
@ -52,13 +52,13 @@ atom_apm_packages:
- pip packages listed in [requirements.txt](https://github.com/robertdebock/ansible-role-atom/blob/master/requirements.txt).
## [Status of requirements](#status-of-requirements)
## [Status of used roles](#status-of-requirements)
The following roles are used to prepare a system. You may choose to prepare your system in another way, I have tested these roles as well.
The following roles are used to prepare a system. You can prepare your system in another way.
| Requirement | GitHub | GitLab |
|-------------|--------|--------|
| [robertdebock.bootstrap](https://galaxy.ansible.com/robertdebock/bootstrap) | [![Build Status GitHub](https://github.com/robertdebock/ansible-role-bootstrap/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-bootstrap/actions) | [![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-ansible-role-bootstrap/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-bootstrap)
|[robertdebock.bootstrap](https://galaxy.ansible.com/robertdebock/bootstrap)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-bootstrap/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-bootstrap/actions)|[![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-bootstrap/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-bootstrap)|
## [Context](#context)
@ -74,10 +74,9 @@ This role has been tested on these [container images](https://hub.docker.com/u/r
|container|tags|
|---------|----|
|el|8|
|debian|buster|
|debian|all|
|fedora|all|
|opensuse|all|
|ubuntu|focal, bionic|
|ubuntu|all|
The minimum version of Ansible required is 2.10, tests have been done to:
@ -87,7 +86,7 @@ The minimum version of Ansible required is 2.10, tests have been done to:
## [Exceptions](#exceptions)
Some variarations of the build matrix do not work. These are the variations and reasons why the build won't work:
Some roles can't run on a specific distribution or version. Here are some exceptions.
| variation | reason |
|---------------------------|------------------------|
@ -102,7 +101,6 @@ If you find issues, please register them in [GitHub](https://github.com/robertde
Apache-2.0
## [Author Information](#author-information)
[Robert de Bock](https://robertdebock.nl/)

View File

@ -1,2 +1,2 @@
install_date: Sun Mar 21 06:59:24 2021
version: 3.0.3
install_date: Wed Aug 3 07:07:03 2022
version: 3.1.3

View File

@ -13,18 +13,14 @@ galaxy_info:
versions:
- 8
- name: Debian
versions:
- buster
- name: Fedora
versions:
- all
- name: OpenSUSE
- name: Fedora
versions:
- all
- name: Ubuntu
versions:
- focal
- bionic
- all
galaxy_tags:
- atom

View File

@ -6,11 +6,11 @@ dependency:
name: galaxy
options:
role-file: requirements.yml
requirements-file: requirements.yml
lint: |
set -e
yamllint .
ansible-lint
ansible-later
driver:
name: docker
platforms:
@ -23,9 +23,5 @@ platforms:
pre_build_image: yes
provisioner:
name: ansible
config_options:
defaults:
stdout_callback: yaml
bin_ansible_callbacks: yes
verifier:
name: ansible

View File

@ -6,4 +6,8 @@
tasks:
- name: check if atom exists works
command: file /usr/bin/atom
ansible.builtin.stat:
path: /usr/bin/atom
register: atom_test_one
failed_when:
- not atom_test_one.stat.exists

View File

@ -1,8 +1,8 @@
---
# tasks file for atom
- name: include assert.yml
import_tasks: assert.yml
- name: import assert.yml
ansible.builtin.import_tasks: assert.yml
run_once: yes
delegate_to: localhost
@ -18,7 +18,7 @@
ansible.builtin.get_url:
url: "{{ atom_package_url }}"
dest: "/tmp/{{ atom_package }}"
checksum: "{{ atom_checksum }}"
# checksum: "{{ atom_checksum }}"
validate_certs: no
when:
- ansible_pkg_mgr in [ "apt", "dnf", "yum", "zypper" ]
@ -55,7 +55,7 @@
- ansible_pkg_mgr == "zypper"
- name: install apm packages
ansible.builtin.command: apm install {{ item }}
args:
ansible.builtin.command:
cmd: apm install {{ item }}
creates: /root/.atom/packages/linter
loop: "{{ atom_apm_packages }}"

View File

@ -3,16 +3,15 @@
#
[tox]
minversion = 3.21.4
# 2.11 has been disabled: couldn't resolve module/action 'docker_container'.
envlist = py{39}-ansible-{2.9,2.10}
envlist = py{39}-ansible-{2.9,2.10,2.11}
skipsdist = true
[testenv]
deps =
2.9: ansible == 2.9.*
2.10: ansible == 2.10.*
2.11: git+https://github.com/ansible/ansible.git@devel
2.10: ansible-base == 2.10.*
2.11: ansible-core == 2.11.*
molecule[docker]
docker == 4.*
ansible-lint == 5.*
@ -23,4 +22,4 @@ setenv =
ANSIBLE_FORCE_COLOR=1
ANSIBLE_ROLES_PATH=../
passenv = namespace image tag
passenv = namespace image tag DOCKER_HOST

View File

@ -19,14 +19,3 @@ _atom_package:
atom_package_url: '{{ _atom_package[ansible_pkg_mgr]["url"] }}'
atom_package: "{{ _atom_package[ansible_pkg_mgr]['name'] }}"
# The checksum of the downloaded artifact, this speeds up the execution of the
# role on second runs as it calculates the (local) checksum and uses the results
# to see if the artifact would need to be downloaded again.
_atom_checksum:
dnf: &rpmchecksum "sha256:e68d293033741f1f76650b73ea896dbfa94f2ebcaef9330a25001362f5523b7e"
yum: *rpmchecksum
zypper: *rpmchecksum
apt: "sha256:e1c650fcfdfc09aafef0ecfe041d254ad9007fb3ca797dafd21c8333fd0b1340"
atom_checksum: "{{ _atom_checksum[ansible_pkg_mgr] }}"

View File

@ -1,3 +1,4 @@
---
#
# Ansible managed
#

View File

@ -5,6 +5,7 @@ about: Create a report to help me improve
---
## Describe the bug
A clear and concise description of what the bug is.
## Playbook

View File

@ -11,7 +11,7 @@ on:
- '*'
pull_request:
schedule:
- cron: '2 2 2 * *'
- cron: '3 2 2 * *'
jobs:
lint:
@ -22,7 +22,7 @@ jobs:
with:
path: "${{ github.repository }}"
- name: molecule
uses: robertdebock/molecule-action@2.6.16
uses: robertdebock/molecule-action@4.0.7
with:
command: lint
test:
@ -33,20 +33,24 @@ jobs:
fail-fast: false
matrix:
config:
- image: "alpine"
tag: "latest"
- image: "amazonlinux"
tag: "latest"
- image: "centos"
- image: "enterpriselinux"
tag: "7"
- image: "centos"
- image: "enterpriselinux"
tag: "latest"
- image: "debian"
tag: "latest"
- image: "debian"
tag: "bullseye"
tag: "bookworm"
- image: "fedora"
tag: "32"
tag: "34"
- image: "fedora"
tag: "latest"
- image: "fedora"
tag: "rawhide"
- image: "opensuse"
tag: "latest"
- image: "ubuntu"
@ -63,7 +67,7 @@ jobs:
- name: parse apparmor for mysql
run: sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
- name: molecule
uses: robertdebock/molecule-action@2.6.16
uses: robertdebock/molecule-action@4.0.7
with:
image: ${{ matrix.config.image }}
tag: ${{ matrix.config.tag }}

View File

@ -3,3 +3,4 @@
*.swp
.tox
.cache
.DS_Store

View File

@ -18,8 +18,7 @@ cache:
install:
- pip install --upgrade pip
- pip install yamllint
- pip install ansible-lint
- pip install ansible ansible-lint yamllint
script:
- yamllint .

View File

@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2021 Robert de Bock (robert@meinit.nl)
Copyright 2022 Robert de Bock (robert@meinit.nl)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@ -8,12 +8,19 @@ Prepare your system to be managed by Ansible.
## [Example Playbook](#example-playbook)
This example is taken from `molecule/resources/converge.yml` and is tested on each push, pull request and release.
This example is taken from `molecule/default/converge.yml` and is tested on each push, pull request and release.
```yaml
---
- name: Converge
hosts: all
become: yes
# This role installs packages using the `raw` module and needs to connect as
# `root`. (`sudo` is not available before bootstrapping.) All tasks in the
# role have `become` set to `no`, so you can use either `no` or `yes` for
# `become`, the role will not use become (so `sudo`) for any task.
become: yes # `no` will also work.
# This role installs python, gathering facts can't be done before `python` is
# installed. This role runs the `setup` module, so facts will be available
# after running the role.
gather_facts: no
roles:
@ -24,14 +31,11 @@ Also see a [full explanation and example](https://robertdebock.nl/how-to-use-the
## [Role Variables](#role-variables)
These variables are set in `defaults/main.yml`:
The default values for the variables are set in `defaults/main.yml`:
```yaml
---
# defaults file for bootstrap
# The user to use to connect to machines.
bootstrap_user: root
# Do you want to wait for the host to be available?
bootstrap_wait_for_host: no
@ -57,12 +61,13 @@ This role has been tested on these [container images](https://hub.docker.com/u/r
|container|tags|
|---------|----|
|alpine|all|
|amazon|Candidate|
|el|7, 8|
|debian|all|
|fedora|all|
|opensuse|all|
|ubuntu|focal, bionic|
|ubuntu|all|
The minimum version of Ansible required is 2.10, tests have been done to:
@ -72,7 +77,7 @@ The minimum version of Ansible required is 2.10, tests have been done to:
## [Exceptions](#exceptions)
Some variarations of the build matrix do not work. These are the variations and reasons why the build won't work:
Some roles can't run on a specific distribution or version. Here are some exceptions.
| variation | reason |
|---------------------------|------------------------|
@ -85,17 +90,6 @@ If you find issues, please register them in [GitHub](https://github.com/robertde
Apache-2.0
## [Contributors](#contributors)
I'd like to thank everybody that made contributions to this repository. It motivates me, improves the code and is just fun to collaborate.
- [rembik](https://github.com/rembik)
- [jellevandehaterd](https://github.com/jellevandehaterd)
- [fzarifian](https://github.com/fzarifian)
- [kmonticolo](https://github.com/kmonticolo)
- [CrystalStiletto](https://github.com/CrystalStiletto)
- [infothrill](https://github.com/infothrill)
## [Author Information](#author-information)
[Robert de Bock](https://robertdebock.nl/)

View File

@ -1,9 +1,6 @@
---
# defaults file for bootstrap
# The user to use to connect to machines.
bootstrap_user: root
# Do you want to wait for the host to be available?
bootstrap_wait_for_host: no

View File

@ -1,2 +1,2 @@
install_date: Sun Mar 21 06:59:27 2021
version: 5.0.3
install_date: Wed Aug 3 07:07:05 2022
version: 6.0.3

View File

@ -1,6 +1,7 @@
---
galaxy_info:
author: Robert de Bock
namespace: robertdebock
role_name: bootstrap
description: Prepare your system to be managed by Ansible.
license: Apache-2.0
@ -8,10 +9,9 @@ galaxy_info:
min_ansible_version: "2.10"
platforms:
# Broken: idempotence, gather_facts: Failed to create temporary directory.
# - name: Alpine
# versions:
# - all
- name: Alpine
versions:
- all
- name: Amazon
versions:
- Candidate
@ -30,8 +30,7 @@ galaxy_info:
- all
- name: Ubuntu
versions:
- focal
- bionic
- all
galaxy_tags:
- bootstrap

View File

@ -1,7 +1,14 @@
---
- name: Converge
hosts: all
become: yes
# This role installs packages using the `raw` module and needs to connect as
# `root`. (`sudo` is not available before bootstrapping.) All tasks in the
# role have `become` set to `no`, so you can use either `no` or `yes` for
# `become`, the role will not use become (so `sudo`) for any task.
become: yes # `no` will also work.
# This role installs python, gathering facts can't be done before `python` is
# installed. This role runs the `setup` module, so facts will be available
# after running the role.
gather_facts: no
roles:

View File

@ -6,6 +6,7 @@ dependency:
name: galaxy
options:
role-file: requirements.yml
requirements-file: requirements.yml
lint: |
set -e
yamllint .
@ -22,9 +23,5 @@ platforms:
pre_build_image: yes
provisioner:
name: ansible
config_options:
defaults:
stdout_callback: yaml
bin_ansible_callbacks: yes
verifier:
name: ansible

View File

@ -6,9 +6,9 @@
tasks:
- name: test connection
ping:
ansible.builtin.ping:
- name: try the package module
package:
ansible.builtin.package:
name: gzip
state: present

View File

@ -1,12 +1,5 @@
---
- name: test if bootstrap_user is set correctly
ansible.builtin.assert:
that:
- bootstrap_user is defined
- bootstrap_user is string
quiet: yes
- name: test if bootstrap_wait_for_host is set correctly
ansible.builtin.assert:
that:

View File

@ -1,12 +1,11 @@
---
- name: lookup bootstrap facts
become: no
ansible.builtin.raw: "cat /etc/os-release"
become: no
check_mode: no
register: bootstrap_facts
changed_when: no
vars:
ansible_user: "{{ bootstrap_user }}"
- name: set bootstrap facts (I)
ansible.builtin.set_fact:
@ -18,6 +17,7 @@
- bootstrap_facts.rc == 0
- bootstrap_distribution is not defined
- bootstrap_facts.stdout is regex('PRETTY_NAME=.'~ bootstrap_search[item] | default(item) ~'.*')
become: no
- name: set bootstrap facts (II)
ansible.builtin.set_fact:
@ -27,3 +27,4 @@
label: "{{ item.key }}"
when:
- bootstrap_distribution in item.value
become: no

View File

@ -1,20 +1,19 @@
---
# tasks file for bootstrap
- name: include assert.yml
import_tasks: assert.yml
- name: import assert.yml
ansible.builtin.import_tasks: assert.yml
run_once: yes
delegate_to: localhost
- name: wait for host
- name: wait for port to be available
ansible.builtin.wait_for:
port: "{{ ansible_port | default('22') }}"
host: "{{ (ansible_ssh_host | default(ansible_host) | default(inventory_hostname)) }}"
connection: local
timeout: "{{ bootstrap_timeout }}"
become: no
when:
- ansible_connection is defined
- ansible_connection not in [ "docker", "container" ]
- ansible_connection not in [ "container", "docker", "community.docker.docker" ]
- bootstrap_wait_for_host | bool
- name: prepare system
@ -26,33 +25,28 @@
changed_when: no
rescue:
- name: gather bootstrap facts
ansible.builtin.include_tasks: gather_facts.yml
ansible.builtin.include_tasks:
file: gather_facts.yml
- name: install bootstrap packages
- name: install bootstrap packages (raw)
ansible.builtin.raw: "{{ bootstrap_install.raw }}"
register: bootstrap_install_packages
changed_when:
- (bootstrap_install.stdout_regex in bootstrap_install_packages.stdout and
bootstrap_os_family in [ "Alpine", "Archlinux", "Gentoo" ]) or
(bootstrap_install.stdout_regex not in bootstrap_install_packages.stdout and
bootstrap_os_family in [ "Debian", "RedHat", "Suse" ])
vars:
ansible_user: "{{ bootstrap_user }}"
always:
- name: set bootstrap_ansible_user
ansible.builtin.set_fact:
bootstrap_ansible_user: "{{ ansible_user | default(omit) if bootstrap_connect is succeeded else bootstrap_user }}"
changed_when: no
bootstrap_os_family in [ "Debian", "RedHat", "Rocky", "Suse" ])
become: no
- name: ensure system is prepared
block:
- name: gather ansible facts
ansible.builtin.setup:
- name: install bootstrap packages
- name: install bootstrap packages (package)
ansible.builtin.package:
name: "{{ item }}"
state: present
loop: "{{ bootstrap_facts_packages.split() }}"
vars:
ansible_user: "{{ bootstrap_ansible_user | default(omit) }}"
become: no

View File

@ -3,18 +3,16 @@
#
[tox]
minversion = 3.21.4
# 2.11 has been disabled: couldn't resolve module/action 'docker_container'.
envlist = py{39}-ansible-{2.9,2.10}
envlist = py{310}-ansible-{4,5}
skipsdist = true
[testenv]
deps =
2.9: ansible == 2.9.*
2.10: ansible == 2.10.*
2.11: git+https://github.com/ansible/ansible.git@devel
4: ansible == 4.*
5: ansible == 5.*
molecule[docker]
docker == 4.*
docker == 5.*
ansible-lint == 5.*
commands = molecule test
setenv =
@ -23,4 +21,4 @@ setenv =
ANSIBLE_FORCE_COLOR=1
ANSIBLE_ROLES_PATH=../
passenv = namespace image tag
passenv = namespace image tag DOCKER_HOST

View File

@ -6,7 +6,7 @@ _bootstrap_packages:
Archlinux: python sudo
Debian: python3 sudo gnupg python3-apt
Gentoo: python sudo gentoolkit
RedHat: python3 sudo
RedHat: &redhat_packages python3 sudo
Suse: python3 python3-xml sudo
Amazon: python sudo
CentOS_7: python sudo
@ -14,6 +14,11 @@ _bootstrap_packages:
Debian_9: python sudo gnupg
RedHat_7: python sudo
# Map the right set of packages, based on gathered bootstrap facts.
bootstrap_packages: "{{ _bootstrap_packages[bootstrap_distribution ~'_'~ bootstrap_distribution_major_version]|default(
_bootstrap_packages[bootstrap_distribution] )|default(
_bootstrap_packages[bootstrap_os_family] ) }}"
_bootstrap_install:
Alpine:
raw: "LANG=C apk update ; apk add {{ bootstrap_packages }}"
@ -35,18 +40,25 @@ _bootstrap_install:
raw: "LANG=C zypper -n install {{ bootstrap_packages }}"
stdout_regex: 'Nothing'
# Map the right install command, based on gathered bootstrap facts.
bootstrap_install: "{{ _bootstrap_install[bootstrap_distribution ~'_'~ bootstrap_distribution_major_version]|default(
_bootstrap_install[bootstrap_distribution] )|default(
_bootstrap_install[bootstrap_os_family] ) }}"
# See URL for available OS families and search queries
# https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/facts/system/distribution.py
bootstrap_os_family_map:
Alpine: [Alpine]
Archlinux: [Archlinux, Antergos, Manjaro]
Debian: [Debian, Ubuntu, Raspbian, Neon, KDE neon,
Linux Mint, SteamOS, Devuan, Kali, 'Cumulus Linux']
Linux Mint, SteamOS, Devuan, Kali, Cumulus Linux,
'Pop!_OS', Parrot, Pardus GNU/Linux]
Gentoo: [Gentoo, Funtoo]
RedHat: [RedHat, Fedora, CentOS, Scientific, SLC,
Ascendos, CloudLinux, PSBM, OracleLinux, OVS,
OEL, Amazon, Virtuozzo, XenServer, Alibaba]
Suse: [SLED, 'openSUSE Tumbleweed', 'openSUSE Leap',
Ascendos, CloudLinux, PSBM, Rocky, OracleLinux,
OVS, OEL, Amazon, Virtuozzo, XenServer, Alibaba,
EulerOS, openEuler, AlmaLinux]
Suse: [SLED, openSUSE Tumbleweed, openSUSE Leap,
SLES_SAP, SUSE_LINUX, SLES, openSUSE, SuSE]
bootstrap_search:
@ -54,17 +66,7 @@ bootstrap_search:
OracleLinux: 'Oracle Linux'
RedHat: 'Red Hat'
# Map the right set of packages, based on gathered bootstrap facts.
bootstrap_packages: "{{ _bootstrap_packages[bootstrap_distribution ~'_'~ bootstrap_distribution_major_version]|default(
_bootstrap_packages[bootstrap_distribution])|default(
_bootstrap_packages[bootstrap_os_family]) }}"
# Map the right install command, based on gathered bootstrap facts.
bootstrap_install: "{{ _bootstrap_install[bootstrap_distribution ~'_'~ bootstrap_distribution_major_version]|default(
_bootstrap_install[bootstrap_distribution])|default(
_bootstrap_install[bootstrap_os_family]) }}"
# Map the right set of packages, based on gathered ansible_facts.
bootstrap_facts_packages: "{{ _bootstrap_packages[ansible_distribution ~'_'~ ansible_distribution_major_version]|default(
_bootstrap_packages[ansible_distribution])|default(
_bootstrap_packages[ansible_os_family]) }}"
_bootstrap_packages[ansible_distribution] )|default(
_bootstrap_packages[ansible_os_family] ) }}"

View File

@ -1,8 +1,8 @@
---
#
# Ansible managed
#
exclude_paths:
- ./meta/exception.yml
- ./meta/preferences.yml
- ./molecule/default/prepare.yml
- ./molecule/default/converge.yml
@ -10,3 +10,5 @@ exclude_paths:
- ./molecule/default/collections.yml
- ./.tox
- ./.cache
- ./.github
- ./requirements.yml

View File

@ -5,6 +5,7 @@ about: Create a report to help me improve
---
## Describe the bug
A clear and concise description of what the bug is.
## Playbook

View File

@ -13,6 +13,6 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: galaxy
uses: robertdebock/galaxy-action@1.1.0
uses: robertdebock/galaxy-action@1.2.0
with:
galaxy_api_key: ${{ secrets.galaxy_api_key }}

View File

@ -11,20 +11,16 @@ on:
- '*'
pull_request:
schedule:
- cron: '2 2 2 * *'
- cron: '3 2 2 * *'
jobs:
lint:
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v2
with:
path: "${{ github.repository }}"
- name: molecule
uses: robertdebock/molecule-action@2.6.16
with:
command: lint
uses: actions/checkout@v3
- name: ansible-lint
uses: ansible-community/ansible-lint-action@main
test:
needs:
- lint
@ -37,27 +33,29 @@ jobs:
tag: "latest"
- image: "amazonlinux"
tag: "latest"
- image: "centos"
tag: "7"
- image: "centos"
- image: "enterpriselinux"
tag: "latest"
- image: "debian"
tag: "latest"
- image: "debian"
tag: "bullseye"
tag: "bookworm"
- image: "fedora"
tag: "32"
tag: "35"
- image: "fedora"
tag: "latest"
- image: "fedora"
tag: "rawhide"
- image: "opensuse"
tag: "latest"
- image: "ubuntu"
tag: "latest"
- image: "ubuntu"
tag: "focal"
- image: "ubuntu"
tag: "bionic"
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: "${{ github.repository }}"
- name: disable apparmor for mysql
@ -65,7 +63,7 @@ jobs:
- name: parse apparmor for mysql
run: sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
- name: molecule
uses: robertdebock/molecule-action@2.6.16
uses: robertdebock/molecule-action@4.0.8
with:
image: ${{ matrix.config.image }}
tag: ${{ matrix.config.tag }}

View File

@ -3,3 +3,4 @@
*.swp
.tox
.cache
.DS_Store

View File

@ -1,30 +0,0 @@
---
#
# Ansible managed
#
language: python
os: linux
dist: xenial
python:
- "3.9"
services:
- docker
cache:
- pip
install:
- pip install --upgrade pip
- pip install yamllint
- pip install ansible-lint
script:
- yamllint .
- ansible-lint
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
email: false

View File

@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2021 Robert de Bock (robert@meinit.nl)
Copyright 2022 Robert de Bock (robert@meinit.nl)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@ -8,7 +8,7 @@ Install buildtools on your system.
## [Example Playbook](#example-playbook)
This example is taken from `molecule/resources/converge.yml` and is tested on each push, pull request and release.
This example is taken from `molecule/default/converge.yml` and is tested on each push, pull request and release.
```yaml
---
- name: Converge
@ -20,7 +20,7 @@ This example is taken from `molecule/resources/converge.yml` and is tested on ea
- role: robertdebock.buildtools
```
The machine needs to be prepared in CI this is done using `molecule/resources/prepare.yml`:
The machine needs to be prepared. In CI this is done using `molecule/default/prepare.yml`:
```yaml
---
- name: Prepare
@ -39,13 +39,13 @@ Also see a [full explanation and example](https://robertdebock.nl/how-to-use-the
- pip packages listed in [requirements.txt](https://github.com/robertdebock/ansible-role-buildtools/blob/master/requirements.txt).
## [Status of requirements](#status-of-requirements)
## [Status of used roles](#status-of-requirements)
The following roles are used to prepare a system. You may choose to prepare your system in another way, I have tested these roles as well.
The following roles are used to prepare a system. You can prepare your system in another way.
| Requirement | GitHub | GitLab |
|-------------|--------|--------|
| [robertdebock.bootstrap](https://galaxy.ansible.com/robertdebock/bootstrap) | [![Build Status GitHub](https://github.com/robertdebock/ansible-role-bootstrap/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-bootstrap/actions) | [![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-ansible-role-bootstrap/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-bootstrap)
|[robertdebock.bootstrap](https://galaxy.ansible.com/robertdebock/bootstrap)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-bootstrap/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-bootstrap/actions)|[![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-bootstrap/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-bootstrap)|
## [Context](#context)
@ -62,11 +62,11 @@ This role has been tested on these [container images](https://hub.docker.com/u/r
|---------|----|
|alpine|all|
|amazon|Candidate|
|el|7, 8|
|debian|buster, bullseye|
|el|8|
|debian|all|
|fedora|all|
|opensuse|all|
|ubuntu|focal, bionic|
|ubuntu|all|
The minimum version of Ansible required is 2.10, tests have been done to:
@ -74,14 +74,6 @@ The minimum version of Ansible required is 2.10, tests have been done to:
- The current version.
- The development version.
## [Exceptions](#exceptions)
Some variarations of the build matrix do not work. These are the variations and reasons why the build won't work:
| variation | reason |
|---------------------------|------------------------|
| EL | No package matching 'bison' found available, installed or updated |
If you find issues, please register them in [GitHub](https://github.com/robertdebock/ansible-role-buildtools/issues)
@ -89,7 +81,6 @@ If you find issues, please register them in [GitHub](https://github.com/robertde
Apache-2.0
## [Author Information](#author-information)
[Robert de Bock](https://robertdebock.nl/)

View File

@ -1,2 +1,2 @@
install_date: Sun Mar 21 06:59:29 2021
version: 3.0.1
install_date: Wed Aug 3 07:07:07 2022
version: 3.1.10

View File

@ -1,4 +0,0 @@
---
exceptions:
- variation: EL
reason: "No package matching 'bison' found available, installed or updated"

View File

@ -1,6 +1,6 @@
---
galaxy_info:
author: Robert de Bock
author: robertdebock
role_name: buildtools
description: Install buildtools on your system.
license: Apache-2.0
@ -16,22 +16,19 @@ galaxy_info:
- Candidate
- name: EL
versions:
- 7
- 8
- "8"
- name: Debian
versions:
- buster
- bullseye
- all
- name: Fedora
versions:
- all
- name: OpenSUSE
- name: opensuse
versions:
- all
- name: Ubuntu
versions:
- focal
- bionic
- all
galaxy_tags:
- development

View File

@ -6,6 +6,7 @@ dependency:
name: galaxy
options:
role-file: requirements.yml
requirements-file: requirements.yml
lint: |
set -e
yamllint .
@ -22,9 +23,5 @@ platforms:
pre_build_image: yes
provisioner:
name: ansible
config_options:
defaults:
stdout_callback: yaml
bin_ansible_callbacks: yes
verifier:
name: ansible

View File

@ -6,13 +6,17 @@
tasks:
- name: run gcc
command: gcc --version
ansible.builtin.command:
cmd: gcc --version
- name: run make
command: make --version
ansible.builtin.command:
cmd: make --version
- name: run shasum
command: shasum --version
ansible.builtin.command:
cmd: shasum --version
- name: run bison
command: bison --version
ansible.builtin.command:
cmd: bison --version

View File

@ -1,3 +1,4 @@
---
roles:
- name: robertdebock.bootstrap
collections:

View File

@ -3,18 +3,16 @@
#
[tox]
minversion = 3.21.4
# 2.11 has been disabled: couldn't resolve module/action 'docker_container'.
envlist = py{39}-ansible-{2.9,2.10}
envlist = py{310}-ansible-{4,5}
skipsdist = true
[testenv]
deps =
2.9: ansible == 2.9.*
2.10: ansible == 2.10.*
2.11: git+https://github.com/ansible/ansible.git@devel
4: ansible == 4.*
5: ansible == 5.*
molecule[docker]
docker == 4.*
docker == 5.*
ansible-lint == 5.*
commands = molecule test
setenv =
@ -23,4 +21,4 @@ setenv =
ANSIBLE_FORCE_COLOR=1
ANSIBLE_ROLES_PATH=../
passenv = namespace image tag
passenv = namespace image tag DOCKER_HOST

View File

@ -53,4 +53,4 @@ _buildtools_packages:
- make
- perl-Digest-SHA1
buildtools_packages: "{{ _buildtools_packages[ansible_distribution ~ '-' ~ ansible_distribution_major_version] | default(_buildtools_packages[ansible_distribution] | default(_buildtools_packages[ansible_os_family] | default (_buildtools_packages['default']))) }}"
buildtools_packages: "{{ _buildtools_packages[ansible_distribution ~ '-' ~ ansible_distribution_major_version] | default(_buildtools_packages[ansible_distribution] | default(_buildtools_packages[ansible_os_family] | default (_buildtools_packages['default'] ))) }}"

View File

@ -1,8 +1,8 @@
---
#
# Ansible managed
#
exclude_paths:
- ./meta/exception.yml
- ./meta/preferences.yml
- ./molecule/default/prepare.yml
- ./molecule/default/converge.yml

View File

@ -5,6 +5,7 @@ about: Create a report to help me improve
---
## Describe the bug
A clear and concise description of what the bug is.
## Playbook

View File

@ -13,6 +13,6 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: galaxy
uses: robertdebock/galaxy-action@1.1.0
uses: robertdebock/galaxy-action@1.2.0
with:
galaxy_api_key: ${{ secrets.galaxy_api_key }}

View File

@ -11,7 +11,7 @@ on:
- '*'
pull_request:
schedule:
- cron: '3 3 3 * *'
- cron: '5 3 3 * *'
jobs:
lint:
@ -22,7 +22,7 @@ jobs:
with:
path: "${{ github.repository }}"
- name: molecule
uses: robertdebock/molecule-action@2.6.16
uses: robertdebock/molecule-action@4.0.7
with:
command: lint
test:
@ -37,22 +37,24 @@ jobs:
tag: "latest"
- image: "amazonlinux"
tag: "latest"
- image: "centos"
tag: "7"
- image: "centos"
- image: "enterpriselinux"
tag: "latest"
- image: "debian"
tag: "latest"
- image: "debian"
tag: "bullseye"
tag: "bookworm"
- image: "fedora"
tag: "32"
tag: "35"
- image: "fedora"
tag: "latest"
- image: "fedora"
tag: "rawhide"
- image: "opensuse"
tag: "latest"
- image: "ubuntu"
tag: "latest"
- image: "ubuntu"
tag: "focal"
- image: "ubuntu"
tag: "bionic"
steps:
@ -65,7 +67,7 @@ jobs:
- name: parse apparmor for mysql
run: sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
- name: molecule
uses: robertdebock/molecule-action@2.6.16
uses: robertdebock/molecule-action@4.0.7
with:
image: ${{ matrix.config.image }}
tag: ${{ matrix.config.tag }}

View File

@ -3,3 +3,4 @@
*.swp
.tox
.cache
.DS_Store

View File

@ -1,30 +0,0 @@
---
#
# Ansible managed
#
language: python
os: linux
dist: xenial
python:
- "3.9"
services:
- docker
cache:
- pip
install:
- pip install --upgrade pip
- pip install yamllint
- pip install ansible-lint
script:
- yamllint .
- ansible-lint
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
email: false

View File

@ -1,21 +0,0 @@
Installation
=========
To use this Ansible role skeleton, as [described in Ansible Galaxy documentation](https://docs.ansible.com/ansible/latest/reference_appendices/galaxy.html#using-a-custom-role-skeleton):
```
export keep_trailing_newline=True
ansible-galaxy init --role-skeleton=/path/to/skeleton role_name
```
or add this to ansible.cfg:
```
[galaxy]
role_skeleton = /path/to/skeleton
role_skeleton_ignore = ^.git$,^.*/.git_keep$
```
Followed by `ansible-galaxy init role_name`.
Don't include `ansible-role` to the role name, for example use `java` instead of `ansible-role-java`.

View File

@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2021 Robert de Bock (robert@meinit.nl)
Copyright 2022 Robert de Bock (robert@meinit.nl)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

Some files were not shown because too many files have changed in this diff Show More