Skip to content

Commit

Permalink
fix: update sshd var to sshd_config in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwillsher committed Sep 13, 2024
1 parent 4758d4b commit f961b0f
Show file tree
Hide file tree
Showing 19 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion tests/tests_all_options.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
# The hostkeys are not valid either so do not validate them
sshd_verify_hostkeys: []
sshd_config_file: /tmp/sshd_config
sshd:
sshd_config:
"{{ sshd_c }}"
when: not sshd_skip_test

Expand Down
6 changes: 3 additions & 3 deletions tests/tests_alternative_file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
sshd_config_owner: "nobody"
sshd_config_group: "nobody"
sshd_config_mode: "660"
sshd:
sshd_config:
AcceptEnv: LANG
Banner: /etc/issue
Ciphers: aes256-ctr
Expand All @@ -46,7 +46,7 @@
# just anything -- will not get processed by sshd
sshd_config_file: /etc/ssh/sshd_config_custom_second
sshd_skip_defaults: true
sshd:
sshd_config:
Banner: /etc/issue2
Ciphers: aes128-ctr
sshd_MaxStartups: 100 # noqa var-naming
Expand All @@ -56,7 +56,7 @@
name: ansible-sshd
vars:
sshd_config_file: /etc/ssh/sshd_config
sshd:
sshd_config:
Banner: /etc/issue
Ciphers: aes192-ctr
HostKey:
Expand Down
6 changes: 3 additions & 3 deletions tests/tests_alternative_file_role.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
sshd_config_owner: "nobody"
sshd_config_group: "nobody"
sshd_config_mode: "660"
sshd:
sshd_config:
AcceptEnv: LANG
Banner: /etc/issue
Ciphers: aes256-ctr
Expand All @@ -50,7 +50,7 @@
# just anything -- will not get processed by sshd
sshd_config_file: /etc/ssh/sshd_config_custom_second
sshd_skip_defaults: true
sshd:
sshd_config:
Banner: /etc/issue2
Ciphers: aes128-ctr
sshd_MaxStartups: 100 # noqa var-naming
Expand All @@ -62,7 +62,7 @@
- ansible-sshd
vars:
sshd_config_file: /etc/ssh/sshd_config
sshd:
sshd_config:
Banner: /etc/issue
Ciphers: aes192-ctr
HostKey:
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_certificates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
ansible.builtin.include_role:
name: ansible-sshd
vars:
sshd:
sshd_config:
PasswordAuthentication: false
TrustedUserCAKeys: /etc/ssh/ca-keys/trusted-user-ca-keys.pub
AuthorizedPrincipalsFile: "/etc/ssh/auth_principals/%u"
Expand Down
4 changes: 2 additions & 2 deletions tests/tests_config_namespace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
vars:
sshd_config_file: /etc/ssh/sshd_config
sshd_config_namespace: nm1
sshd:
sshd_config:
PasswordAuthentication: true
PermitRootLogin: true
Match:
Expand All @@ -29,7 +29,7 @@
vars:
sshd_config_file: /etc/ssh/sshd_config
sshd_config_namespace: nm2
sshd:
sshd_config:
PasswordAuthentication: false
PermitRootLogin: false
Match:
Expand Down
6 changes: 3 additions & 3 deletions tests/tests_firewall_selinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
vars:
sshd_manage_selinux: "{{ __sshd_test_selinux }}"
sshd_manage_firewall: "{{ __sshd_test_firewall }}"
sshd:
sshd_config:
Port: 22

- name: Verify the options are correctly set
Expand Down Expand Up @@ -65,7 +65,7 @@
vars:
sshd_manage_firewall: "{{ __sshd_test_firewall }}"
sshd_manage_selinux: "{{ __sshd_test_selinux }}"
sshd:
sshd_config:
Port: 222

- name: Verify the options are correctly set
Expand Down Expand Up @@ -93,7 +93,7 @@
vars:
sshd_manage_firewall: "{{ __sshd_test_firewall }}"
sshd_manage_selinux: "{{ __sshd_test_selinux }}"
sshd:
sshd_config:
Port:
- 22
- 222
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_hostkeys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
sshd_hostkey_owner: "nobody"
sshd_hostkey_group: "nobody"
sshd_hostkey_mode: "0664"
sshd:
sshd_config:
HostKey:
- /tmp/ssh_host_rsa_key2

Expand Down
2 changes: 1 addition & 1 deletion tests/tests_hostkeys_missing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
name: ansible-sshd
vars:
sshd_verify_hostkeys: []
sshd:
sshd_config:
HostKey:
- /tmp/missing_ssh_host_rsa_key
register: role_result
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_hostkeys_role.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
sshd_hostkey_owner: "nobody"
sshd_hostkey_group: "nobody"
sshd_hostkey_mode: "0664"
sshd:
sshd_config:
HostKey:
- /tmp/ssh_host_rsa_key2

Expand Down
4 changes: 2 additions & 2 deletions tests/tests_include_present.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
name: ansible-sshd
vars:
sshd_config_file: /etc/ssh/sshd_config.d/00-ansible_system_role.conf
sshd:
sshd_config:
Banner: /etc/include-issue
Ciphers: aes192-ctr
when:
Expand Down Expand Up @@ -114,7 +114,7 @@
sshd_config_file: /etc/ssh/custom_sshd_config.d/custom-drop-in
sshd_main_config_file: /etc/ssh/custom_sshd_config
sshd_drop_in_dir_mode: '0770'
sshd:
sshd_config:
Banner: /etc/include-issue
Ciphers: aes192-ctr

Expand Down
2 changes: 1 addition & 1 deletion tests/tests_indent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
ansible.builtin.include_role:
name: ansible-sshd
vars:
sshd:
sshd_config:
PasswordAuthentication: true
PermitRootLogin: true
AcceptEnv:
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_match.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# For Fedora containers, we need to make sure we have keys for sshd -T below
sshd_verify_hostkeys:
- /etc/ssh/ssh_host_rsa_key
sshd:
sshd_config:
Match:
Condition: "User xusers"
X11Forwarding: true
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_match_iterate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# For Fedora containers, we need to make sure we have keys for sshd -T below
sshd_verify_hostkeys:
- /etc/ssh/ssh_host_rsa_key
sshd:
sshd_config:
Match:
- Condition: "User xusers"
X11Forwarding: true
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_precedence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
ansible.builtin.include_role:
name: ansible-sshd
vars:
sshd:
sshd_config:
Banner: /etc/issue
Ciphers: aes256-ctr
HostKey: /etc/ssh/ssh_host_rsa_key
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_second_service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
sshd_config_file: /etc/ssh2/sshd_config
sshd_install_service: true
sshd_manage_selinux: true
sshd:
sshd_config:
Port: 2222
ForceCommand: echo "CONNECTED2"

Expand Down
2 changes: 1 addition & 1 deletion tests/tests_second_service_drop_in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
sshd_config_file: /etc/ssh2/sshd_config.d/04-ansible.conf
sshd_install_service: true
sshd_manage_selinux: true
sshd:
sshd_config:
Port: 2222
ForceCommand: echo "CONNECTED2"

Expand Down
2 changes: 1 addition & 1 deletion tests/tests_set_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
ansible.builtin.include_role:
name: ansible-sshd
vars:
sshd:
sshd_config:
AcceptEnv: LANG
Banner: /etc/issue
Ciphers: aes256-ctr
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_set_uncommon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
ansible.builtin.include_role:
name: ansible-sshd
vars:
sshd:
sshd_config:
# Unsupported in new versions, but ignored ?
Protocol: 1
UsePrivilegeSeparation: false
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_sshd_enable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
name: ansible-sshd
vars:
sshd_enable: false
sshd:
sshd_config:
AcceptEnv: XDG_*
Banner: /etc/issue
Ciphers: aes256-ctr,aes128-ctr
Expand Down

0 comments on commit f961b0f

Please sign in to comment.