48 Commits

Author SHA1 Message Date
a732eb0479 chore(deps): update ansible/ansible-lint action to v26
All checks were successful
Lint Markdown files / markdown-lint (pull_request) Successful in 4s
Ansible Linter / ansible-lint (push) Successful in 18s
Lint Markdown files / markdown-lint (push) Successful in 5s
Ansible Linter / ansible-lint (pull_request) Successful in 58s
2026-01-08 17:01:25 +00:00
1ec88f37fb fix(ci): use dynamic github repository name
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 19s
Lint Markdown files / markdown-lint (push) Successful in 4s
Release Ansible Role / Release Ansible Role (push) Successful in 56s
2026-01-07 16:09:07 +01:00
09c4173eaf docs(ci): get steps a dedicated name
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 19s
Lint Markdown files / markdown-lint (push) Successful in 4s
2026-01-07 16:02:12 +01:00
14f856fdea fix(ci): add release workflow
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 20s
Lint Markdown files / markdown-lint (push) Successful in 4s
Release to Ansible Galaxy / release (push) Successful in 59s
2026-01-07 16:00:01 +01:00
86d85c431c fix!: rename environments to envs
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 19s
Lint Markdown files / markdown-lint (push) Successful in 4s
2026-01-07 11:16:12 +01:00
88e9a163e1 docs: support environment variables in authorized_keys file
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 18s
Lint Markdown files / markdown-lint (push) Successful in 5s
2026-01-07 10:35:40 +01:00
69491c9aa0 feat: support environment variables in authorized_keys file
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 21s
Lint Markdown files / markdown-lint (push) Successful in 5s
2026-01-07 10:28:13 +01:00
47d9a58910 fix: replace deprecated INJECT_FACTS_AS_VARS
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 17s
Lint Markdown files / markdown-lint (push) Successful in 4s
2026-01-05 10:28:33 +01:00
e176bb0bee Merge pull request 'chore(deps): update ansible/ansible-lint action to v25.12.2' (#45) from renovate/actions into master
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 18s
Lint Markdown files / markdown-lint (push) Successful in 5s
2025-12-22 20:06:24 +00:00
9acd6de876 chore(deps): update ansible/ansible-lint action to v25.12.2
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 18s
Lint Markdown files / markdown-lint (push) Successful in 4s
Lint Markdown files / markdown-lint (pull_request) Successful in 5s
Ansible Linter / ansible-lint (pull_request) Successful in 56s
2025-12-22 20:01:29 +00:00
c0566e2416 Merge pull request 'chore(deps): update ansible/ansible-lint action to v25.12.1' (#44) from renovate/actions into master
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 17s
Lint Markdown files / markdown-lint (push) Successful in 4s
2025-12-10 14:06:34 +00:00
509882a193 chore(deps): update ansible/ansible-lint action to v25.12.1
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 17s
Lint Markdown files / markdown-lint (push) Successful in 4s
Ansible Linter / ansible-lint (pull_request) Successful in 17s
Lint Markdown files / markdown-lint (pull_request) Successful in 4s
2025-12-10 14:01:33 +00:00
e98925af4b Merge pull request 'chore(deps): update actions/checkout action to v6' (#43) from renovate/actions-checkout-6.x into master
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 18s
Lint Markdown files / markdown-lint (push) Successful in 4s
2025-12-02 21:09:51 +00:00
8a25dac377 chore(deps): update actions/checkout action to v6
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 18s
Lint Markdown files / markdown-lint (pull_request) Successful in 4s
Lint Markdown files / markdown-lint (push) Successful in 4s
Ansible Linter / ansible-lint (pull_request) Successful in 59s
2025-12-02 21:01:40 +00:00
7602cc621c Merge pull request 'chore(deps): update ansible/ansible-lint action to v25.12.0' (#42) from renovate/actions into master
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 18s
Lint Markdown files / markdown-lint (push) Successful in 5s
2025-12-02 17:05:49 +00:00
b7560320dc chore(deps): update ansible/ansible-lint action to v25.12.0
All checks were successful
Ansible Linter / ansible-lint (pull_request) Successful in 17s
Lint Markdown files / markdown-lint (pull_request) Successful in 5s
Lint Markdown files / markdown-lint (push) Successful in 4s
Ansible Linter / ansible-lint (push) Successful in 59s
2025-12-02 17:01:25 +00:00
4241502728 Merge pull request 'chore(deps): update ansible/ansible-lint action to v25.11.1' (#41) from renovate/actions into master
All checks were successful
Lint Markdown files / markdown-lint (push) Successful in 11s
Ansible Linter / ansible-lint (push) Successful in 18s
2025-11-24 23:06:01 +00:00
f5062ff179 chore(deps): update ansible/ansible-lint action to v25.11.1
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 17s
Lint Markdown files / markdown-lint (push) Successful in 5s
Ansible Linter / ansible-lint (pull_request) Successful in 18s
Lint Markdown files / markdown-lint (pull_request) Successful in 5s
2025-11-24 23:01:45 +00:00
e4c12b9856 fix: set btrfs device
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 24s
Lint Markdown files / markdown-lint (push) Successful in 4s
2025-11-22 23:42:42 +01:00
13a4c84978 fix(npm): remove npm dependencies
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 20s
Lint Markdown files / markdown-lint (push) Successful in 5s
2025-11-18 22:53:51 +01:00
0a89f30f92 Merge pull request 'chore(deps): update davidanson/markdownlint-cli2-action action to v21' (#39) from renovate/davidanson-markdownlint-cli2-action-21.x into master
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 57s
Lint Markdown files / markdown-lint (push) Successful in 9s
2025-11-18 17:02:07 +00:00
2640acca4d chore(deps): update davidanson/markdownlint-cli2-action action to v21
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 58s
Lint Markdown files / markdown-lint (push) Successful in 9s
Ansible Linter / ansible-lint (pull_request) Successful in 57s
Lint Markdown files / markdown-lint (pull_request) Successful in 10s
2025-11-17 20:01:33 +00:00
278d723aa1 Merge pull request 'chore(deps): update actions/checkout action to v5.0.1' (#40) from renovate/actions into master
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 58s
Lint Markdown files / markdown-lint (push) Successful in 10s
2025-11-17 17:20:38 +00:00
bc61cf3fa8 chore(deps): update actions/checkout action to v5.0.1
All checks were successful
Ansible Linter / ansible-lint (pull_request) Successful in 57s
Ansible Linter / ansible-lint (push) Successful in 58s
Lint Markdown files / markdown-lint (pull_request) Successful in 10s
Lint Markdown files / markdown-lint (push) Successful in 9s
2025-11-17 17:02:03 +00:00
015f9aacee fix(netrc): typo maschine
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 21s
Lint Markdown files / markdown-lint (push) Successful in 4s
2025-11-16 11:41:52 +01:00
b4c70b472e Merge pull request 'chore(deps): update ansible/ansible-lint action to v25.11.0' (#38) from renovate/actions into master
All checks were successful
Lint Markdown files / markdown-lint (push) Successful in 4s
Ansible Linter / ansible-lint (push) Successful in 57s
2025-11-10 14:07:29 +00:00
fc2b257c98 chore(deps): update ansible/ansible-lint action to v25.11.0
All checks were successful
Ansible Linter / ansible-lint (pull_request) Successful in 17s
Lint Markdown files / markdown-lint (pull_request) Successful in 3s
Ansible Linter / ansible-lint (push) Successful in 17s
Lint Markdown files / markdown-lint (push) Successful in 3s
2025-11-10 14:01:50 +00:00
22048124fd refac: use .yaml instead of .yml extension
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 24s
Lint Markdown files / markdown-lint (push) Successful in 4s
2025-10-25 12:38:00 +02:00
0db7c7265a Merge pull request 'chore(deps): update ansible/ansible-lint action to v25.9.2' (#36) from renovate/actions into master
All checks were successful
Lint Markdown files / markdown-lint (push) Successful in 4s
Ansible Linter / ansible-lint (push) Successful in 58s
2025-10-08 13:06:21 +00:00
8249283978 chore(deps): update ansible/ansible-lint action to v25.9.2
All checks were successful
Lint Markdown files / markdown-lint (push) Successful in 4s
Ansible Linter / ansible-lint (pull_request) Successful in 17s
Lint Markdown files / markdown-lint (pull_request) Successful in 4s
Ansible Linter / ansible-lint (push) Successful in 58s
2025-10-08 13:02:29 +00:00
c5c832e0b3 Merge pull request 'chore(deps): update ansible/ansible-lint action to v25.9.1' (#35) from renovate/actions into master
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 16s
Lint Markdown files / markdown-lint (push) Successful in 4s
2025-10-01 13:07:09 +00:00
b58cd93dff chore(deps): update ansible/ansible-lint action to v25.9.1
All checks were successful
Lint Markdown files / markdown-lint (push) Successful in 8s
Ansible Linter / ansible-lint (push) Successful in 18s
Lint Markdown files / markdown-lint (pull_request) Successful in 5s
Ansible Linter / ansible-lint (pull_request) Successful in 56s
2025-10-01 13:03:00 +00:00
75b5e3fb32 chore(deps): update dependency @vscode/vsce to v3.6.2
All checks were successful
Ansible Linter / ansible-lint (pull_request) Successful in 25s
Lint Markdown files / markdown-lint (pull_request) Successful in 3s
Lint Markdown files / markdown-lint (push) Successful in 9s
Ansible Linter / ansible-lint (push) Successful in 20s
2025-09-26 16:01:30 +00:00
42478da122 Merge pull request 'chore(deps): update ansible/ansible-lint action to v25.9.0' (#32) from renovate/actions into master
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 19s
Lint Markdown files / markdown-lint (push) Successful in 4s
2025-09-19 19:57:48 +00:00
a4ee09ad9d Merge pull request 'chore(deps): update actions/checkout action to v5' (#33) from renovate/actions-checkout-5.x into master
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 16s
Lint Markdown files / markdown-lint (push) Successful in 4s
2025-09-19 19:39:50 +00:00
d72731c835 chore(deps): update actions/checkout action to v5
All checks were successful
Lint Markdown files / markdown-lint (push) Successful in 15s
Ansible Linter / ansible-lint (pull_request) Successful in 18s
Lint Markdown files / markdown-lint (pull_request) Successful in 4s
Ansible Linter / ansible-lint (push) Successful in 2m53s
2025-09-18 22:03:50 +00:00
a938dab1ec chore(deps): update ansible/ansible-lint action to v25.9.0
All checks were successful
Ansible Linter / ansible-lint (pull_request) Successful in 3m56s
Lint Markdown files / markdown-lint (push) Successful in 11s
Ansible Linter / ansible-lint (push) Successful in 1m7s
Lint Markdown files / markdown-lint (pull_request) Successful in 4s
2025-09-18 22:03:44 +00:00
042c91f42e chore(deps): update actions/checkout to v5.0.0
All checks were successful
Lint Markdown files / markdown-lint (push) Successful in 4s
Ansible Linter / ansible-lint (push) Successful in 17s
2025-09-18 22:33:29 +02:00
f49f61bbc4 Merge pull request 'chore(deps): update ansible/ansible-lint action to v25.8.2' (#31) from renovate/actions into master
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 15s
Lint Markdown files / markdown-lint (push) Successful in 15s
2025-08-21 16:06:06 +00:00
551eed98d5 chore(deps): update ansible/ansible-lint action to v25.8.2
All checks were successful
Lint Markdown files / markdown-lint (push) Successful in 4s
Ansible Linter / ansible-lint (pull_request) Successful in 15s
Lint Markdown files / markdown-lint (pull_request) Successful in 15s
Ansible Linter / ansible-lint (push) Successful in 57s
2025-08-21 16:02:41 +00:00
e172e4990f Merge pull request 'chore(deps): update ansible/ansible-lint action to v25.8.1' (#30) from renovate/actions into master
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 15s
Lint Markdown files / markdown-lint (push) Successful in 21s
2025-08-14 01:05:25 +00:00
0e8f256a26 chore(deps): update ansible/ansible-lint action to v25.8.1
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 15s
Lint Markdown files / markdown-lint (push) Successful in 4s
Ansible Linter / ansible-lint (pull_request) Successful in 15s
Lint Markdown files / markdown-lint (pull_request) Successful in 8s
2025-08-14 01:02:26 +00:00
e8d9c85aa5 Merge pull request 'chore(deps): update ansible/ansible-lint action to v25.8.0' (#29) from renovate/actions into master
All checks were successful
Lint Markdown files / markdown-lint (push) Successful in 10s
Ansible Linter / ansible-lint (push) Successful in 15s
2025-08-13 16:05:18 +00:00
1ac0da5661 chore(deps): update ansible/ansible-lint action to v25.8.0
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 14s
Ansible Linter / ansible-lint (pull_request) Successful in 15s
Lint Markdown files / markdown-lint (pull_request) Successful in 10s
Lint Markdown files / markdown-lint (push) Successful in 20s
2025-08-13 16:02:19 +00:00
345c739489 Merge pull request 'chore(deps): update actions/checkout action to v4.3.0' (#27) from renovate/actions into master
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 16s
Lint Markdown files / markdown-lint (push) Successful in 4s
2025-08-11 13:24:03 +00:00
e05d5d9574 chore(deps): update actions/checkout action to v4.3.0
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 55s
Lint Markdown files / markdown-lint (push) Successful in 10s
Ansible Linter / ansible-lint (pull_request) Successful in 56s
Lint Markdown files / markdown-lint (pull_request) Successful in 10s
2025-08-11 13:03:56 +00:00
7a757ee119 fix(ansible-galaxy): adapt indentation
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 38s
Lint Markdown files / markdown-lint (push) Successful in 12s
2025-08-06 16:10:36 +02:00
c552f95227 fix(default): rename file
Some checks failed
Lint Markdown files / markdown-lint (push) Successful in 10s
Ansible Linter / ansible-lint (push) Failing after 41s
2025-08-06 15:24:39 +02:00
16 changed files with 115 additions and 32 deletions

View File

@@ -12,9 +12,9 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6.0.1
- name: Run ansible-lint
uses: ansible/ansible-lint@v25.7.0
uses: ansible/ansible-lint@v26.1.0
with:
args: "--config-file .ansible-lint"
setup_python: "true"

View File

@@ -12,7 +12,7 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- uses: DavidAnson/markdownlint-cli2-action@v20.0.0
- uses: actions/checkout@v6.0.1
- uses: DavidAnson/markdownlint-cli2-action@v21.0.0
with:
globs: '**/*.md'

View File

@@ -0,0 +1,21 @@
name: Release Ansible Role
on:
push:
tags:
- '**'
jobs:
release:
name: Release Ansible Role
runs-on: ubuntu-latest
steps:
- name: Install Ansible Galaxy
run: |
apt update --yes
apt install --yes ansible
- env:
ANSIBLE_GALAXY_TOKEN: ${{ secrets.ANSIBLE_GALAXY_TOKEN }}
name: Update Ansible Role in Ansible Galaxy
run: |
ansible-galaxy role import --token=${ANSIBLE_GALAXY_TOKEN} volker-raschek ${GITHUB_REPOSITORY#*/}

14
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,14 @@
{
"ansible.python.interpreterPath": "/bin/python",
"files.associations": {
"**/.gitea/**/*.yml": "yaml",
"**/.gitea/**/*.yaml": "yaml",
"docker-compose*.yml": "dockercompose",
"*.yml": "ansible",
"*.yaml": "ansible",
".yamllint": "yaml",
".yamllint.yml": "yaml",
".yamllint.yaml": "yaml"
},
"rewrap.wrappingColumn": 120
}

View File

@@ -77,7 +77,11 @@ The SSH client directory `~/.ssh` can also be managed via the Ansible role. This
`~/.ssh/config`, `~/.ssh/authorized_keys` as well as the maintenance of private and public SSH keys.
The following example create two entries in `~/.ssh/authorized_keys`. One normal SSH access for `claire`. If `bob`
establish a SSH connection the command `/usr/local/bin/upload-file.sh` will be executed and exited.
establish a SSH connection the command `/usr/local/bin/upload-file.sh` will be executed and exited. Furthermore,
environment variables can be espcilitly defined, to consume it during execution of the command.
> [!IMPORTANT]
> To allow consuming environment variables must be set `PermitUserEnvironment yes` in `/etc/ssh/sshd_config`.
The private key `toor@toor-pc.ed25519.key` must be stored in `ssh/private_keys`. The public key will be automatically
extracted from the private key.
@@ -99,6 +103,9 @@ unix_users:
authorized_keys:
- filename: claire@claire-pc.pub
- command: /usr/local/bin/upload-file.sh
envs:
- key: SSH_KEY_NAME
value: bob@bob-pc
filename: bob@bob-pc.pub
private_keys:
- toor@toor-pc.ed25519.key

View File

@@ -4,24 +4,24 @@ galaxy_info:
company: "Cryptic Systems"
description: "Role to create and configure unix users and groups"
galaxy_tags:
- system
- user
- unix
- linux
- system
- user
- unix
- linux
license: "MIT"
min_ansible_version: "2.9"
namespace: volker-raschek
platforms:
- name: ArchLinux
versions:
- all
- name: EL
versions:
- all
- name: Fedora
versions:
- all
- name: Ubuntu
versions:
- all
- name: ArchLinux
versions:
- all
- name: EL
versions:
- all
- name: Fedora
versions:
- all
- name: Ubuntu
versions:
- all
role_name: "unix_users"

View File

@@ -8,9 +8,33 @@
when: unix_user.value.btrfs is defined and
unix_user.value.btrfs
block:
- name: "Find btrfs device"
ansible.builtin.command:
cmd: /bin/bash -c "findmnt -no SOURCE -T {{ user_user_home }} | sed 's/\[.*\]//'"
register: _unix_users_btrfs_device
failed_when: _unix_users_btrfs_device.rc != 0
changed_when: _unix_users_btrfs_device.rc == 0
- name: "Found btrfs device"
ansible.builtin.debug:
msg: _unix_users_btrfs_device.stdout
when: _unix_users_debug is defined and
_unix_users_debug is true
- name: "Determine filesystem of device"
ansible.builtin.set_fact:
_unix_users_device_filesystem: "{{ ansible_facts['mounts'] | selectattr('device', 'equalto', _unix_users_btrfs_device.stdout) | map(attribute='fstype') | first }}"
- name: "Fail if device does not have a btrfs file system"
ansible.builtin.fail:
msg: "Determined device {{ _unix_users_btrfs_device.stdout }} does not have a btrfs filesystem"
when: _unix_users_device_filesystem != 'btrfs'
- name: "Create btrfs volume for unix user: {{ unix_user.key }}"
community.general.btrfs_subvolume:
filesystem_device: "{{ _unix_users_btrfs_device.stdout }}"
name: "{{ user_user_home }}"
state: present
- name: "Adapt home dir permissions"
ansible.builtin.file:
path: "{{ user_user_home }}"
@@ -76,7 +100,7 @@
unix_user.value.btrfs
block:
- name: "Copy skel files"
ansible.builtin.include_tasks: copy_skel_file.yml
ansible.builtin.include_tasks: copy_skel_file.yaml
loop_control:
loop_var: skel_file
with_items:
@@ -190,7 +214,7 @@
- name: "Create shell rc files"
when: unix_user.value.shell_rc_files is defined
ansible.builtin.include_tasks: create_shell_rc_file.yml
ansible.builtin.include_tasks: create_shell_rc_file.yaml
with_items:
- "{{ unix_user.value.shell_rc_files }}"
loop_control:

View File

@@ -1,7 +1,7 @@
---
- name: Remove unix user
ansible.builtin.include_tasks: remove_unix_user.yml
ansible.builtin.include_tasks: remove_unix_user.yaml
with_dict: "{{ unix_users }}"
loop_control:
loop_var: unix_user
@@ -11,7 +11,7 @@
unix_user.value.state == 'absent'
- name: Remove unix groups
ansible.builtin.include_tasks: remove_unix_group.yml
ansible.builtin.include_tasks: remove_unix_group.yaml
with_dict: "{{ unix_groups }}"
loop_control:
loop_var: unix_group
@@ -21,7 +21,7 @@
unix_group.value.state == 'absent'
- name: Create unix groups
ansible.builtin.include_tasks: create_unix_group.yml
ansible.builtin.include_tasks: create_unix_group.yaml
with_dict: "{{ unix_groups }}"
loop_control:
loop_var: unix_group
@@ -33,7 +33,7 @@
)
- name: Create unix users
ansible.builtin.include_tasks: create_unix_user.yml
ansible.builtin.include_tasks: create_unix_user.yaml
no_log: true
with_dict: "{{ unix_users }}"
loop_control:

View File

@@ -3,9 +3,26 @@
# {{ ansible_managed }}
#
{% for authorized_key in unix_user.value.ssh.authorized_keys %}
{% if authorized_key.command is defined and authorized_key.command | length > 0 %}
command="{{ authorized_key.command }}" {{ lookup('file', 'ssh/authorized_keys/' + authorized_key.filename ) }}
{% else %}
{% set _args = [] %}
{% if authorized_key.command is defined and authorized_key.command | length > 0 %}
{% set _args = _args + [ "command=\"" + authorized_key.command + "\"" ] %}
{% endif %}
{% if authorized_key.envs is defined %}
{% set ns = namespace(envs=[]) %}
{% for environment in authorized_key.envs %}
{% if environment.key is defined and environment.key | length > 0 and
environment.value is defined and environment.value | length > 0
%}
{% set ns.envs = ns.envs + [ environment.key + "=" + environment.value ] %}
{% endif %}
{% endfor %}
{% if ns.envs | length > 0 %}
{% set _args = _args + [ "environment=\"" + (ns.envs | join(',')) + "\"" ] %}
{% endif %}
{% endif %}
{% if _args | length > 0 %}
{{ _args | join(',') }} {{ lookup('file', 'ssh/authorized_keys/' + authorized_key.filename ) }}
{% else %}
{{ lookup('file', 'ssh/authorized_keys/' + authorized_key.filename ) }}
{% endif %}
{% endif %}
{% endfor %}

View File

@@ -1,3 +1,3 @@
{% for netrc in unix_user.value.netrc %}
machine {{ netrc.maschine }} login {{ netrc.login }} password {{ netrc.password }}
machine {{ netrc.machine }} login {{ netrc.login }} password {{ netrc.password }}
{% endfor %}