Add molecule and fix bugs
ci/woodpecker/push/woodpecker Pipeline failed
Details
ci/woodpecker/push/woodpecker Pipeline failed
Details
This commit is contained in:
parent
2b9ce6d0d2
commit
5c3df56bc8
|
@ -0,0 +1,30 @@
|
||||||
|
---
|
||||||
|
- name: Converge
|
||||||
|
hosts: all
|
||||||
|
become: true
|
||||||
|
|
||||||
|
pre_tasks:
|
||||||
|
- name: Update the apt cache
|
||||||
|
ansible.builtin.dnf:
|
||||||
|
name:
|
||||||
|
- openssh
|
||||||
|
- openssh-server
|
||||||
|
|
||||||
|
- name: Stop and Start ssh
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: sshd
|
||||||
|
state: restarted
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- role: slococo.playground.ssh_config
|
||||||
|
- role: slococo.playground.local_accounts
|
||||||
|
vars:
|
||||||
|
local_accounts_list:
|
||||||
|
- name: local_adm
|
||||||
|
shell: /bin/bash
|
||||||
|
userid: 38000087
|
||||||
|
- name: local_log
|
||||||
|
shell: /bin/sh
|
||||||
|
userid: 38000088
|
||||||
|
expiry_date: '2024-12-31'
|
||||||
|
passwordless: true
|
|
@ -0,0 +1,23 @@
|
||||||
|
---
|
||||||
|
dependency:
|
||||||
|
name: galaxy
|
||||||
|
ooptions:
|
||||||
|
ignore-errors: true
|
||||||
|
driver:
|
||||||
|
name: docker
|
||||||
|
platforms:
|
||||||
|
- name: instance
|
||||||
|
image: "docker.io/geerlingguy/docker-rockylinux8-ansible:latest"
|
||||||
|
command: ${MOLECULE_DOCKER_COMMAND:-""}
|
||||||
|
volumes:
|
||||||
|
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
||||||
|
cgroupns_mode: host
|
||||||
|
privileged: true
|
||||||
|
pre_build_image: true
|
||||||
|
provisioner:
|
||||||
|
name: ansible
|
||||||
|
config_options:
|
||||||
|
defaults:
|
||||||
|
remote_tmp: /tmp
|
||||||
|
playbooks:
|
||||||
|
converge: ${MOLECULE_PLAYBOOK:-converge.yml}
|
|
@ -21,6 +21,7 @@
|
||||||
- name: Generate SSH key pairs for local users
|
- name: Generate SSH key pairs for local users
|
||||||
community.crypto.openssh_keypair:
|
community.crypto.openssh_keypair:
|
||||||
path: "{{ key_path }}_{{ item.name }}"
|
path: "{{ key_path }}_{{ item.name }}"
|
||||||
|
type: ed25519
|
||||||
loop: "{{ accounts_with_home }}"
|
loop: "{{ accounts_with_home }}"
|
||||||
when: item.passwordless | default(false) | bool
|
when: item.passwordless | default(false) | bool
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
|
@ -31,6 +32,8 @@
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ item.home }}/.ssh"
|
path: "{{ item.home }}/.ssh"
|
||||||
state: directory
|
state: directory
|
||||||
|
owner: "{{ item.name }}"
|
||||||
|
group: "{{ item.name }}"
|
||||||
mode: '0700'
|
mode: '0700'
|
||||||
loop: "{{ accounts_with_home }}"
|
loop: "{{ accounts_with_home }}"
|
||||||
when: item.passwordless | default(false) | bool
|
when: item.passwordless | default(false) | bool
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
userid: 1002
|
userid: 1002
|
||||||
expiry_date: '2024-12-31'
|
expiry_date: '2024-12-31'
|
||||||
home: /home/test_user2_another
|
home: /home/test_user2_another
|
||||||
groups: docker
|
groups: ['docker', 'root']
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role: slococo.playground.local_accounts
|
- role: slococo.playground.local_accounts
|
||||||
|
|
Loading…
Reference in New Issue