Skip to content

Commit

Permalink
Merge pull request #428 from konstruktoid/test
Browse files Browse the repository at this point in the history
add sshd_match_user variables
  • Loading branch information
konstruktoid authored Oct 27, 2023
2 parents 0b4daed + bb5950e commit 078c359
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
10 changes: 10 additions & 0 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ provisioner:
- vagrant
- sudo
suid_sgid_permissions: false
sshd_match_users:
- user: testuser01
rules:
- AllowUsers testuser01
- AuthenticationMethods password
- PasswordAuthentication yes
- user: testuser02
rules:
- AllowUsers testuser02
- Banner none
platforms:
- name: almalinux8
box: almalinux/8
Expand Down
13 changes: 13 additions & 0 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@
ansible.builtin.set_fact:
crypto_policies_config: "{{ stat_crypto_policies_config.stat.exists }}"

- name: Create test users
become: true
ansible.builtin.user:
name: "{{ item }}"
shell: /bin/bash
create_home: true
generate_ssh_key: true
ssh_key_bits: 3072
ssh_key_file: .ssh/id_rsa
loop:
- testuser01
- testuser02

- name: Set sysctl configuration directory as fact
tags:
- fact
Expand Down
10 changes: 10 additions & 0 deletions molecule/single/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ provisioner:
- sudo
suid_sgid_permissions: false
umask_value: "027"
sshd_match_users:
- user: testuser01
rules:
- AllowUsers testuser01
- AuthenticationMethods password
- PasswordAuthentication yes
- user: testuser02
rules:
- AllowUsers testuser02
- Banner none
platforms:
- name: focal
box: bento/ubuntu-20.04
Expand Down

0 comments on commit 078c359

Please sign in to comment.