generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial commit of the system_settings_general module (#21)
- Loading branch information
Showing
10 changed files
with
395 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ disable= | |
import-error, | ||
no-name-in-module, | ||
wrong-import-position, | ||
too-many-branches, | ||
|
||
[BASIC] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
- name: converge | ||
hosts: all | ||
become: true | ||
tasks: | ||
- name: Converge - Set hostname | ||
puzzle.opnsense.system_settings_general: | ||
hostname: opnsense01 | ||
|
||
- name: Converge - Set domain | ||
puzzle.opnsense.system_settings_general: | ||
domain: example.org | ||
|
||
- name: Converge - Set timezone | ||
puzzle.opnsense.system_settings_general: | ||
timezone: Europe/Zurich | ||
|
||
- name: Get hostname | ||
ansible.builtin.command: hostname | ||
register: hostname_value | ||
changed_when: false | ||
|
||
- name: Get current tz | ||
ansible.builtin.stat: | ||
path: /etc/localtime | ||
register: current_tz_stat | ||
changed_when: false | ||
|
||
- name: Get desired tz | ||
ansible.builtin.stat: | ||
path: /usr/share/zoneinfo/Europe/Zurich | ||
register: desired_tz_stat | ||
changed_when: false | ||
|
||
- name: Compare hostname | ||
ansible.builtin.assert: | ||
that: hostname_value.stdout == "opnsense01.example.org" | ||
|
||
- name: Compare tz | ||
ansible.builtin.assert: | ||
that: desired_tz_stat.stat.checksum == current_tz_stat.stat.checksum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
scenario: | ||
name: system_settings_general | ||
test_sequence: | ||
# - dependency not relevant uless we have requirements | ||
- destroy | ||
- syntax | ||
- create | ||
- converge | ||
- idempotence | ||
- verify | ||
- destroy | ||
|
||
driver: | ||
name: vagrant | ||
parallel: true | ||
|
||
platforms: | ||
- name: "22.7" | ||
hostname: false | ||
box: puzzle/opnsense | ||
box_version: "22.7" | ||
memory: 1024 | ||
cpus: 2 | ||
instance_raw_config_args: | ||
- 'vm.guest = :freebsd' | ||
- 'ssh.sudo_command = "%c"' | ||
- 'ssh.shell = "/bin/sh"' | ||
- name: "23.1" | ||
box: puzzle/opnsense | ||
hostname: false | ||
box_version: "23.1" | ||
memory: 1024 | ||
cpus: 2 | ||
instance_raw_config_args: | ||
- 'vm.guest = :freebsd' | ||
- 'ssh.sudo_command = "%c"' | ||
- 'ssh.shell = "/bin/sh"' | ||
- name: "23.7" | ||
box: puzzle/opnsense | ||
hostname: false | ||
box_version: "23.7" | ||
memory: 1024 | ||
cpus: 2 | ||
instance_raw_config_args: | ||
- 'vm.guest = :freebsd' | ||
- 'ssh.sudo_command = "%c"' | ||
- 'ssh.shell = "/bin/sh"' | ||
|
||
provisioner: | ||
name: ansible | ||
env: | ||
ANSIBLE_VERBOSITY: 3 | ||
verifier: | ||
name: ansible | ||
options: | ||
become: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
- name: Verify connectivity to server | ||
hosts: all | ||
tasks: | ||
- name: Ping the server | ||
ansible.builtin.ping: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.