Skip to content

Commit

Permalink
Merge pull request #16 from thorian93/devel
Browse files Browse the repository at this point in the history
Release 1.0.0
  • Loading branch information
thorian93 authored Mar 30, 2024
2 parents d6b20f1 + 40341ca commit 31794bd
Show file tree
Hide file tree
Showing 85 changed files with 716 additions and 390 deletions.
2 changes: 2 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ exclude_paths:
- .vagrant/
- changelogs/
- docs/
- molecule/

# parseable: true
# quiet: true
# verbosity: 1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/molecule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
- ssh
- sudo
- upgrade
- webserver

steps:
- name: Check out code
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,28 @@ thorian93.main Release Notes

.. contents:: Topics

v0.0.3
======

Release Summary
---------------

Spring clean.

Minor Changes
-------------

- Upgrade role - Add trigger for Checkmk APT check.
- All roles - Add support for Rocky Linux 9.

Removed Features
----------------

- All roles - Remove support for CentOS 7.

v0.0.2
======

Release Summary
---------------

Expand Down
10 changes: 5 additions & 5 deletions roles/upgrade/CONTRIBUTING.md → CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# How to contribute

I'm really glad you're reading this, because that means you enjoy my stuff to an extend, where you want to engage.
I'm really glad you're reading this, because that means you enjoy my stuff to an extent, where you want to engage.

## Testing

I personally try to ensure high quality content which means I test my roles against a set of operating systems. I appreciate if you do the same, but if you do not have the time or your contribution targets only one operating system just let me know and I will do the quality assurance for you if possible.
I personally try to ensure high quality content which means I test my roles against a set of operating systems. I appreciate if you do the same, but if you do not have the time or your contribution targets only one operating system just let me know and, I will do the quality assurance for you if possible.

## Submitting changes

Expand All @@ -13,18 +13,18 @@ I do not require elaborate formatting of PRs, please just make sure I can unders
Always write a clear log message for your commits. One-line messages are fine for small changes, but bigger changes should look like this:

$ git commit -m "A brief summary of the commit
>
>
> A paragraph describing what changed and its impact."

## Coding conventions

Start reading the code and you'll get the hang of it quite quickly.
I try to stick to Ansible and YAML conventions to the best of my knowledge.
I do appreciate if you use `yamllint` and `ansible-lint` to ensure proper linting. My repository contains configuration files for that.
Additionally I keep the code clean and readable by following some simple guidelines:
Additionally, I keep the code clean and readable by following some simple guidelines:

* Task names are enclosed by double quotation marks (`""`) and end with a period (`.`)
* Truthy values are enclosed by single quotation marks (`''`)
* Truthy values are enclosed by single quotation marks (`''`)
* This is open source software. Consider the people who will read your code, and make it look nice for them. It's sort of like flying a plane: Perhaps you love doing loops when you're alone, but with passengers the goal is to make the flight as smooth as possible.

Thanks for your contribution!
2 changes: 1 addition & 1 deletion changelogs/.plugin-cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ plugins:
strategy: {}
test: {}
vars: {}
version: 0.0.2
version: 0.0.3
6 changes: 6 additions & 0 deletions changelogs/archive/0.0.3/0.0.3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
minor_changes:
- Upgrade role - Add trigger for Checkmk APT check.
- All roles - Add support for Rocky Linux 9.

removed_features:
- All roles - Remove support for CentOS 7.
11 changes: 11 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,14 @@ releases:
fragments:
- 0.0.2.yml
release_date: '2023-04-29'
0.0.3:
release_date: '2024-03-23'
changes:
minor_changes:
- Upgrade role - Add trigger for Checkmk APT check.
- All roles - Add support for Rocky Linux 9.
removed_features:
- All roles - Remove support for CentOS 7.
release_summary: Spring clean.
fragments:
- 0.0.3.yml
11 changes: 11 additions & 0 deletions changelogs/fragments/1.0.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
release_summary: "Spring clean!"

bugfixes:
- Fix a lot of linting findings across the board.

major_changes:
- Add webserver role.

breaking_changes:
- Common role - Rename variable `shopt_options` to `common_shopt_options`. Please adapt your inventory if necessary!
- SSH role - Change prefix for all variables from `sshd_` to `ssh_`. Please adapt your inventory if necessary!
6 changes: 4 additions & 2 deletions galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace: thorian93
name: main

# The version of the collection. Must be compatible with semantic versioning
version: 0.0.3
version: 1.0.0

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
Expand Down Expand Up @@ -41,7 +41,9 @@ tags: [thorian93, linux, administration, infrastructure]
# collection label 'namespace.name'. The value is a version range
# L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version
# range specifiers can be set and are separated by ','
dependencies: {}
dependencies:
"community.general": ">=5.0.0"
"ansible.posix": ">=1.4.0"

# The URL of the originating SCM repository
repository: https://github.com/thorian93/main
Expand Down
1 change: 0 additions & 1 deletion requirements.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
collections:
- name: thorian93.main
version: 0.0.3
3 changes: 2 additions & 1 deletion roles/certmanage/.ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ parseable: true
skip_list: []
use_default_rules: true
verbosity: 1
exclude_paths: []
exclude_paths:
- molecule/
2 changes: 1 addition & 1 deletion roles/certmanage/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ galaxy_info:
description: Local Certificate Store Management
license: "license (MIT)"

min_ansible_version: 2.9
min_ansible_version: "2.9"

galaxy_tags:
- linux
Expand Down
5 changes: 4 additions & 1 deletion roles/certmanage/tasks/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
state: directory
owner: root
group: root
mode: '0755'
mode: 0755

- name: Copy the Certificates.
ansible.builtin.template:
src: "certificate.pem.j2"
dest: "/usr/local/share/ca-certificates/certificate_{{ item.name }}.crt"
owner: root
group: root
mode: 0644
with_items: "{{ certmanage_certificates }}"
register: upload_cert_result

Expand Down
5 changes: 4 additions & 1 deletion roles/certmanage/tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
state: directory
owner: root
group: root
mode: '0755'
mode: 0755

- name: Copy the Certificates.
ansible.builtin.template:
src: "certificate.pem.j2"
dest: "/etc/pki/ca-trust/source/anchors/certificate_{{ item.name }}.pem"
owner: root
group: root
mode: 0644
with_items: "{{ certmanage_certificates }}"
register: upload_cert_result

Expand Down
9 changes: 3 additions & 6 deletions roles/common/.ansible-lint
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
---
parseable: true
skip_list:
- 301
- 305
- ANSIBLE0012
- ANSIBLE0013
skip_list: []
use_default_rules: true
verbosity: 1
exclude_paths: []
exclude_paths:
- molecule/
21 changes: 0 additions & 21 deletions roles/common/LICENSE

This file was deleted.

2 changes: 1 addition & 1 deletion roles/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Configure the timezone.

Configure general paths.

shopt_options:
common_shopt_options:
- shopt -s cdspell
- shopt -s nocaseglob

Expand Down
2 changes: 1 addition & 1 deletion roles/common/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ common_scripting_scripts_stage: []
common_scripting_scripts_role: []

# Shopt options
shopt_options:
common_shopt_options:
- shopt -s cdspell
- shopt -s nocaseglob

Expand Down
2 changes: 1 addition & 1 deletion roles/common/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ galaxy_info:
description: Common System Management
license: "license (MIT)"

min_ansible_version: 2.9
min_ansible_version: "2.9"

galaxy_tags:
- linux
Expand Down
38 changes: 21 additions & 17 deletions roles/common/tasks/Debian.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
---
- name: "Configure shopt Preferences."
ansible.builtin.lineinfile:
dest: /etc/bash.bashrc
line: "{{ item }}"
create: true
mode: 0644
with_items: "{{ shopt_options }}"
dest: /etc/bash.bashrc
line: "{{ item }}"
create: true
owner: root
group: root
mode: 0644
with_items: "{{ common_shopt_options }}"

- name: "Configure Bash Completion."
ansible.builtin.blockinfile:
dest: /etc/bash.bashrc
create: true
mode: 0644
marker: "# {mark} ANSIBLE MANAGED BLOCK"
content: |
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
dest: /etc/bash.bashrc
create: true
owner: root
group: root
mode: 0644
marker: "# {mark} ANSIBLE MANAGED BLOCK"
content: |
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
8 changes: 7 additions & 1 deletion roles/common/tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@
dest: /etc/bashrc
line: "{{ item }}"
create: true
with_items: "{{ shopt_options }}"
owner: root
group: root
mode: 0644
with_items: "{{ common_shopt_options }}"

- name: "Configure Bash Completion."
ansible.builtin.blockinfile:
dest: /etc/bashrc
create: true
owner: root
group: root
mode: 0644
marker: "# {mark} ANSIBLE MANAGED BLOCK"
content: |
if ! shopt -oq posix; then
Expand Down
11 changes: 8 additions & 3 deletions roles/common/tasks/Suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@
dest: /etc/bash.bashrc
line: "{{ item }}"
create: true
with_items: "{{ shopt_options }}"
owner: root
group: root
mode: 0644
with_items: "{{ common_shopt_options }}"

- name: "Configure Bash Completion."
ansible.builtin.blockinfile:
dest: /etc/bash.bashrc
create: true
owner: root
group: root
mode: 0644
marker: "# {mark} ANSIBLE MANAGED BLOCK"
content: |
if ! shopt -oq posix; then
Expand All @@ -21,6 +27,5 @@
fi
- name: "Workaround - Install python-xml."

Check failure on line 29 in roles/common/tasks/Suse.yml

View workflow job for this annotation

GitHub Actions / Run Linting

no-changed-when

Commands should not change things if nothing needs doing.
ansible.builtin.shell: zypper in -y python-xml
args:
ansible.builtin.command: zypper in -y python-xml
when: ansible_distribution == "opensuse Leap" and ansible_distribution_major_version == "15"
1 change: 0 additions & 1 deletion roles/common/tasks/disks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@

- name: "Disable disk checks on all ext4 disk devices."

Check failure on line 11 in roles/common/tasks/disks.yml

View workflow job for this annotation

GitHub Actions / Run Linting

no-changed-when

Commands should not change things if nothing needs doing.
ansible.builtin.command: "tune2fs -c 0 -i 0 {{ item }}"
args:
with_items: "{{ common_disks_list.stdout_lines }}"
when: ('container' not in ansible_facts.virtualization_tech_guest)
2 changes: 1 addition & 1 deletion roles/common/tasks/groups.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: "Concatenate Groups Presence Variables."
set_fact:
ansible.builtin.set_fact:
common_groups_present: >-

Check warning on line 4 in roles/common/tasks/groups.yml

View workflow job for this annotation

GitHub Actions / Run Linting

jinja[spacing]

Jinja2 spacing could be improved: {{ common_global_groups_present | default('') | list + common_os_groups_present | default('') | list + common_system_groups_present | default('') | list + common_stage_groups_present | default('') | list + common_role_groups_present | default('') | list }} -> {{ common_global_groups_present | default('') | list + common_os_groups_present | default('') | list + common_system_groups_present | default('') | list + common_stage_groups_present | default('') | list + common_role_groups_present | default('') | list }}
{{ common_global_groups_present | default('') | list +
common_os_groups_present | default('') | list +
Expand Down
8 changes: 4 additions & 4 deletions roles/common/tasks/scripting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
- name: "Concatenate Scripting Variables."
ansible.builtin.set_fact:
common_scripting_scripts: >-
{{ common_scripting_scripts_global | default('') | list +
common_scripting_scripts_os | default('') | list +
common_scripting_scripts_system | default('') | list +
common_scripting_scripts_stage | default('') | list +
{{ common_scripting_scripts_global | default('') | list +
common_scripting_scripts_os | default('') | list +
common_scripting_scripts_system | default('') | list +
common_scripting_scripts_stage | default('') | list +
common_scripting_scripts_role | default('') | list }}
- name: "Create Scripts Path."
Expand Down
Loading

0 comments on commit 31794bd

Please sign in to comment.