From 3d877047bf913d8449d68b060187abaf27b2aeff Mon Sep 17 00:00:00 2001 From: Boris Glimcher Date: Tue, 13 Feb 2024 20:50:44 +0200 Subject: [PATCH] ci: add new empty roles Signed-off-by: Boris Glimcher --- roles/bmc_factory_reset/README.md | 38 ++++++++++++++ roles/bmc_factory_reset/defaults/main.yml | 2 + roles/bmc_factory_reset/handlers/main.yml | 2 + roles/bmc_factory_reset/meta/main.yml | 52 +++++++++++++++++++ .../molecule/default/converge.yml | 8 +++ .../molecule/default/create.yml | 35 +++++++++++++ .../molecule/default/destroy.yml | 24 +++++++++ .../molecule/default/molecule.yml | 6 +++ roles/bmc_factory_reset/tasks/main.yml | 2 + roles/bmc_factory_reset/tests/inventory | 2 + roles/bmc_factory_reset/tests/test.yml | 5 ++ roles/bmc_factory_reset/vars/main.yml | 2 + roles/bmc_reboot/README.md | 38 ++++++++++++++ roles/bmc_reboot/defaults/main.yml | 2 + roles/bmc_reboot/handlers/main.yml | 2 + roles/bmc_reboot/meta/main.yml | 52 +++++++++++++++++++ .../bmc_reboot/molecule/default/converge.yml | 8 +++ roles/bmc_reboot/molecule/default/create.yml | 35 +++++++++++++ roles/bmc_reboot/molecule/default/destroy.yml | 24 +++++++++ .../bmc_reboot/molecule/default/molecule.yml | 6 +++ roles/bmc_reboot/tasks/main.yml | 2 + roles/bmc_reboot/tests/inventory | 2 + roles/bmc_reboot/tests/test.yml | 5 ++ roles/bmc_reboot/vars/main.yml | 2 + roles/enable_secure_boot/README.md | 38 ++++++++++++++ roles/enable_secure_boot/defaults/main.yml | 2 + roles/enable_secure_boot/handlers/main.yml | 2 + roles/enable_secure_boot/meta/main.yml | 52 +++++++++++++++++++ .../molecule/default/converge.yml | 8 +++ .../molecule/default/create.yml | 35 +++++++++++++ .../molecule/default/destroy.yml | 24 +++++++++ .../molecule/default/molecule.yml | 6 +++ roles/enable_secure_boot/tasks/main.yml | 2 + roles/enable_secure_boot/tests/inventory | 2 + roles/enable_secure_boot/tests/test.yml | 5 ++ roles/enable_secure_boot/vars/main.yml | 2 + roles/get_bmc_facts/README.md | 38 ++++++++++++++ roles/get_bmc_facts/defaults/main.yml | 2 + roles/get_bmc_facts/handlers/main.yml | 2 + roles/get_bmc_facts/meta/main.yml | 52 +++++++++++++++++++ .../molecule/default/converge.yml | 8 +++ .../get_bmc_facts/molecule/default/create.yml | 35 +++++++++++++ .../molecule/default/destroy.yml | 24 +++++++++ .../molecule/default/molecule.yml | 6 +++ roles/get_bmc_facts/tasks/main.yml | 2 + roles/get_bmc_facts/tests/inventory | 2 + roles/get_bmc_facts/tests/test.yml | 5 ++ roles/get_bmc_facts/vars/main.yml | 2 + roles/update_bmc_password/README.md | 38 ++++++++++++++ roles/update_bmc_password/defaults/main.yml | 2 + roles/update_bmc_password/handlers/main.yml | 2 + roles/update_bmc_password/meta/main.yml | 52 +++++++++++++++++++ .../molecule/default/converge.yml | 8 +++ .../molecule/default/create.yml | 35 +++++++++++++ .../molecule/default/destroy.yml | 24 +++++++++ .../molecule/default/molecule.yml | 6 +++ roles/update_bmc_password/tasks/main.yml | 2 + roles/update_bmc_password/tests/inventory | 2 + roles/update_bmc_password/tests/test.yml | 5 ++ roles/update_bmc_password/vars/main.yml | 2 + 60 files changed, 890 insertions(+) create mode 100644 roles/bmc_factory_reset/README.md create mode 100644 roles/bmc_factory_reset/defaults/main.yml create mode 100644 roles/bmc_factory_reset/handlers/main.yml create mode 100644 roles/bmc_factory_reset/meta/main.yml create mode 100644 roles/bmc_factory_reset/molecule/default/converge.yml create mode 100644 roles/bmc_factory_reset/molecule/default/create.yml create mode 100644 roles/bmc_factory_reset/molecule/default/destroy.yml create mode 100644 roles/bmc_factory_reset/molecule/default/molecule.yml create mode 100644 roles/bmc_factory_reset/tasks/main.yml create mode 100644 roles/bmc_factory_reset/tests/inventory create mode 100644 roles/bmc_factory_reset/tests/test.yml create mode 100644 roles/bmc_factory_reset/vars/main.yml create mode 100644 roles/bmc_reboot/README.md create mode 100644 roles/bmc_reboot/defaults/main.yml create mode 100644 roles/bmc_reboot/handlers/main.yml create mode 100644 roles/bmc_reboot/meta/main.yml create mode 100644 roles/bmc_reboot/molecule/default/converge.yml create mode 100644 roles/bmc_reboot/molecule/default/create.yml create mode 100644 roles/bmc_reboot/molecule/default/destroy.yml create mode 100644 roles/bmc_reboot/molecule/default/molecule.yml create mode 100644 roles/bmc_reboot/tasks/main.yml create mode 100644 roles/bmc_reboot/tests/inventory create mode 100644 roles/bmc_reboot/tests/test.yml create mode 100644 roles/bmc_reboot/vars/main.yml create mode 100644 roles/enable_secure_boot/README.md create mode 100644 roles/enable_secure_boot/defaults/main.yml create mode 100644 roles/enable_secure_boot/handlers/main.yml create mode 100644 roles/enable_secure_boot/meta/main.yml create mode 100644 roles/enable_secure_boot/molecule/default/converge.yml create mode 100644 roles/enable_secure_boot/molecule/default/create.yml create mode 100644 roles/enable_secure_boot/molecule/default/destroy.yml create mode 100644 roles/enable_secure_boot/molecule/default/molecule.yml create mode 100644 roles/enable_secure_boot/tasks/main.yml create mode 100644 roles/enable_secure_boot/tests/inventory create mode 100644 roles/enable_secure_boot/tests/test.yml create mode 100644 roles/enable_secure_boot/vars/main.yml create mode 100644 roles/get_bmc_facts/README.md create mode 100644 roles/get_bmc_facts/defaults/main.yml create mode 100644 roles/get_bmc_facts/handlers/main.yml create mode 100644 roles/get_bmc_facts/meta/main.yml create mode 100644 roles/get_bmc_facts/molecule/default/converge.yml create mode 100644 roles/get_bmc_facts/molecule/default/create.yml create mode 100644 roles/get_bmc_facts/molecule/default/destroy.yml create mode 100644 roles/get_bmc_facts/molecule/default/molecule.yml create mode 100644 roles/get_bmc_facts/tasks/main.yml create mode 100644 roles/get_bmc_facts/tests/inventory create mode 100644 roles/get_bmc_facts/tests/test.yml create mode 100644 roles/get_bmc_facts/vars/main.yml create mode 100644 roles/update_bmc_password/README.md create mode 100644 roles/update_bmc_password/defaults/main.yml create mode 100644 roles/update_bmc_password/handlers/main.yml create mode 100644 roles/update_bmc_password/meta/main.yml create mode 100644 roles/update_bmc_password/molecule/default/converge.yml create mode 100644 roles/update_bmc_password/molecule/default/create.yml create mode 100644 roles/update_bmc_password/molecule/default/destroy.yml create mode 100644 roles/update_bmc_password/molecule/default/molecule.yml create mode 100644 roles/update_bmc_password/tasks/main.yml create mode 100644 roles/update_bmc_password/tests/inventory create mode 100644 roles/update_bmc_password/tests/test.yml create mode 100644 roles/update_bmc_password/vars/main.yml diff --git a/roles/bmc_factory_reset/README.md b/roles/bmc_factory_reset/README.md new file mode 100644 index 0000000..225dd44 --- /dev/null +++ b/roles/bmc_factory_reset/README.md @@ -0,0 +1,38 @@ +Role Name +========= + +A brief description of the role goes here. + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/bmc_factory_reset/defaults/main.yml b/roles/bmc_factory_reset/defaults/main.yml new file mode 100644 index 0000000..82f10f8 --- /dev/null +++ b/roles/bmc_factory_reset/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for bmc_factory_reset diff --git a/roles/bmc_factory_reset/handlers/main.yml b/roles/bmc_factory_reset/handlers/main.yml new file mode 100644 index 0000000..27edfeb --- /dev/null +++ b/roles/bmc_factory_reset/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for bmc_factory_reset diff --git a/roles/bmc_factory_reset/meta/main.yml b/roles/bmc_factory_reset/meta/main.yml new file mode 100644 index 0000000..c572acc --- /dev/null +++ b/roles/bmc_factory_reset/meta/main.yml @@ -0,0 +1,52 @@ +galaxy_info: + author: your name + description: your role description + company: your company (optional) + + # If the issue tracker for your role is not on github, uncomment the + # next line and provide a value + # issue_tracker_url: http://example.com/issue/tracker + + # Choose a valid license ID from https://spdx.org - some suggested licenses: + # - BSD-3-Clause (default) + # - MIT + # - GPL-2.0-or-later + # - GPL-3.0-only + # - Apache-2.0 + # - CC-BY-4.0 + license: license (GPL-2.0-or-later, MIT, etc) + + min_ansible_version: 2.1 + + # If this a Container Enabled role, provide the minimum Ansible Container version. + # min_ansible_container_version: + + # + # Provide a list of supported platforms, and for each platform a list of versions. + # If you don't wish to enumerate all versions for a particular platform, use 'all'. + # To view available platforms and versions (or releases), visit: + # https://galaxy.ansible.com/api/v1/platforms/ + # + # platforms: + # - name: Fedora + # versions: + # - all + # - 25 + # - name: SomePlatform + # versions: + # - all + # - 1.0 + # - 7 + # - 99.99 + + galaxy_tags: [] + # List tags for your role here, one per line. A tag is a keyword that describes + # and categorizes the role. Users find roles by searching for tags. Be sure to + # remove the '[]' above, if you add tags to this list. + # + # NOTE: A tag is limited to a single word comprised of alphanumeric characters. + # Maximum 20 tags per role. + +dependencies: [] + # List your role dependencies here, one per line. Be sure to remove the '[]' above, + # if you add dependencies to this list. diff --git a/roles/bmc_factory_reset/molecule/default/converge.yml b/roles/bmc_factory_reset/molecule/default/converge.yml new file mode 100644 index 0000000..e600756 --- /dev/null +++ b/roles/bmc_factory_reset/molecule/default/converge.yml @@ -0,0 +1,8 @@ +--- +- name: Converge + hosts: all + gather_facts: false + tasks: + - name: Replace this task with one that validates your content + ansible.builtin.debug: + msg: "This is the effective test" diff --git a/roles/bmc_factory_reset/molecule/default/create.yml b/roles/bmc_factory_reset/molecule/default/create.yml new file mode 100644 index 0000000..fcd6b92 --- /dev/null +++ b/roles/bmc_factory_reset/molecule/default/create.yml @@ -0,0 +1,35 @@ +--- +- name: Create + hosts: localhost + connection: local + gather_facts: false + # no_log: "{{ molecule_no_log }}" + tasks: + # TODO: Developer must implement and populate 'server' variable + + - name: Create instance config + when: server.changed | default(false) | bool # noqa no-handler + block: + - name: Populate instance config dict # noqa jinja + ansible.builtin.set_fact: + instance_conf_dict: {} + # instance': "{{ }}", + # address': "{{ }}", + # user': "{{ }}", + # port': "{{ }}", + # 'identity_file': "{{ }}", } + with_items: "{{ server.results }}" + register: instance_config_dict + + - name: Convert instance config dict to a list + ansible.builtin.set_fact: + instance_conf: "{{ instance_config_dict.results | map(attribute='ansible_facts.instance_conf_dict') | list }}" + + - name: Dump instance config + ansible.builtin.copy: + content: | + # Molecule managed + + {{ instance_conf | to_json | from_json | to_yaml }} + dest: "{{ molecule_instance_config }}" + mode: "0600" diff --git a/roles/bmc_factory_reset/molecule/default/destroy.yml b/roles/bmc_factory_reset/molecule/default/destroy.yml new file mode 100644 index 0000000..59d6a8e --- /dev/null +++ b/roles/bmc_factory_reset/molecule/default/destroy.yml @@ -0,0 +1,24 @@ +--- +- name: Destroy + hosts: localhost + connection: local + gather_facts: false + # no_log: "{{ molecule_no_log }}" + tasks: + # Developer must implement. + + # Mandatory configuration for Molecule to function. + + - name: Populate instance config + ansible.builtin.set_fact: + instance_conf: {} + + - name: Dump instance config + ansible.builtin.copy: + content: | + # Molecule managed + + {{ instance_conf | to_json | from_json | to_yaml }} + dest: "{{ molecule_instance_config }}" + mode: "0600" + when: server.changed | default(false) | bool # noqa no-handler diff --git a/roles/bmc_factory_reset/molecule/default/molecule.yml b/roles/bmc_factory_reset/molecule/default/molecule.yml new file mode 100644 index 0000000..b524ee7 --- /dev/null +++ b/roles/bmc_factory_reset/molecule/default/molecule.yml @@ -0,0 +1,6 @@ +--- +platforms: + - name: instance + # you might want to add your own variables here based on what provisioning + # you are doing like: + # image: quay.io/centos/centos:stream8 diff --git a/roles/bmc_factory_reset/tasks/main.yml b/roles/bmc_factory_reset/tasks/main.yml new file mode 100644 index 0000000..cb422d4 --- /dev/null +++ b/roles/bmc_factory_reset/tasks/main.yml @@ -0,0 +1,2 @@ +--- +# tasks file for bmc_factory_reset diff --git a/roles/bmc_factory_reset/tests/inventory b/roles/bmc_factory_reset/tests/inventory new file mode 100644 index 0000000..878877b --- /dev/null +++ b/roles/bmc_factory_reset/tests/inventory @@ -0,0 +1,2 @@ +localhost + diff --git a/roles/bmc_factory_reset/tests/test.yml b/roles/bmc_factory_reset/tests/test.yml new file mode 100644 index 0000000..e7d1237 --- /dev/null +++ b/roles/bmc_factory_reset/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + remote_user: root + roles: + - bmc_factory_reset diff --git a/roles/bmc_factory_reset/vars/main.yml b/roles/bmc_factory_reset/vars/main.yml new file mode 100644 index 0000000..d0095a2 --- /dev/null +++ b/roles/bmc_factory_reset/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for bmc_factory_reset diff --git a/roles/bmc_reboot/README.md b/roles/bmc_reboot/README.md new file mode 100644 index 0000000..225dd44 --- /dev/null +++ b/roles/bmc_reboot/README.md @@ -0,0 +1,38 @@ +Role Name +========= + +A brief description of the role goes here. + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/bmc_reboot/defaults/main.yml b/roles/bmc_reboot/defaults/main.yml new file mode 100644 index 0000000..9d51a65 --- /dev/null +++ b/roles/bmc_reboot/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for bmc_reboot diff --git a/roles/bmc_reboot/handlers/main.yml b/roles/bmc_reboot/handlers/main.yml new file mode 100644 index 0000000..658a70c --- /dev/null +++ b/roles/bmc_reboot/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for bmc_reboot diff --git a/roles/bmc_reboot/meta/main.yml b/roles/bmc_reboot/meta/main.yml new file mode 100644 index 0000000..c572acc --- /dev/null +++ b/roles/bmc_reboot/meta/main.yml @@ -0,0 +1,52 @@ +galaxy_info: + author: your name + description: your role description + company: your company (optional) + + # If the issue tracker for your role is not on github, uncomment the + # next line and provide a value + # issue_tracker_url: http://example.com/issue/tracker + + # Choose a valid license ID from https://spdx.org - some suggested licenses: + # - BSD-3-Clause (default) + # - MIT + # - GPL-2.0-or-later + # - GPL-3.0-only + # - Apache-2.0 + # - CC-BY-4.0 + license: license (GPL-2.0-or-later, MIT, etc) + + min_ansible_version: 2.1 + + # If this a Container Enabled role, provide the minimum Ansible Container version. + # min_ansible_container_version: + + # + # Provide a list of supported platforms, and for each platform a list of versions. + # If you don't wish to enumerate all versions for a particular platform, use 'all'. + # To view available platforms and versions (or releases), visit: + # https://galaxy.ansible.com/api/v1/platforms/ + # + # platforms: + # - name: Fedora + # versions: + # - all + # - 25 + # - name: SomePlatform + # versions: + # - all + # - 1.0 + # - 7 + # - 99.99 + + galaxy_tags: [] + # List tags for your role here, one per line. A tag is a keyword that describes + # and categorizes the role. Users find roles by searching for tags. Be sure to + # remove the '[]' above, if you add tags to this list. + # + # NOTE: A tag is limited to a single word comprised of alphanumeric characters. + # Maximum 20 tags per role. + +dependencies: [] + # List your role dependencies here, one per line. Be sure to remove the '[]' above, + # if you add dependencies to this list. diff --git a/roles/bmc_reboot/molecule/default/converge.yml b/roles/bmc_reboot/molecule/default/converge.yml new file mode 100644 index 0000000..e600756 --- /dev/null +++ b/roles/bmc_reboot/molecule/default/converge.yml @@ -0,0 +1,8 @@ +--- +- name: Converge + hosts: all + gather_facts: false + tasks: + - name: Replace this task with one that validates your content + ansible.builtin.debug: + msg: "This is the effective test" diff --git a/roles/bmc_reboot/molecule/default/create.yml b/roles/bmc_reboot/molecule/default/create.yml new file mode 100644 index 0000000..fcd6b92 --- /dev/null +++ b/roles/bmc_reboot/molecule/default/create.yml @@ -0,0 +1,35 @@ +--- +- name: Create + hosts: localhost + connection: local + gather_facts: false + # no_log: "{{ molecule_no_log }}" + tasks: + # TODO: Developer must implement and populate 'server' variable + + - name: Create instance config + when: server.changed | default(false) | bool # noqa no-handler + block: + - name: Populate instance config dict # noqa jinja + ansible.builtin.set_fact: + instance_conf_dict: {} + # instance': "{{ }}", + # address': "{{ }}", + # user': "{{ }}", + # port': "{{ }}", + # 'identity_file': "{{ }}", } + with_items: "{{ server.results }}" + register: instance_config_dict + + - name: Convert instance config dict to a list + ansible.builtin.set_fact: + instance_conf: "{{ instance_config_dict.results | map(attribute='ansible_facts.instance_conf_dict') | list }}" + + - name: Dump instance config + ansible.builtin.copy: + content: | + # Molecule managed + + {{ instance_conf | to_json | from_json | to_yaml }} + dest: "{{ molecule_instance_config }}" + mode: "0600" diff --git a/roles/bmc_reboot/molecule/default/destroy.yml b/roles/bmc_reboot/molecule/default/destroy.yml new file mode 100644 index 0000000..59d6a8e --- /dev/null +++ b/roles/bmc_reboot/molecule/default/destroy.yml @@ -0,0 +1,24 @@ +--- +- name: Destroy + hosts: localhost + connection: local + gather_facts: false + # no_log: "{{ molecule_no_log }}" + tasks: + # Developer must implement. + + # Mandatory configuration for Molecule to function. + + - name: Populate instance config + ansible.builtin.set_fact: + instance_conf: {} + + - name: Dump instance config + ansible.builtin.copy: + content: | + # Molecule managed + + {{ instance_conf | to_json | from_json | to_yaml }} + dest: "{{ molecule_instance_config }}" + mode: "0600" + when: server.changed | default(false) | bool # noqa no-handler diff --git a/roles/bmc_reboot/molecule/default/molecule.yml b/roles/bmc_reboot/molecule/default/molecule.yml new file mode 100644 index 0000000..b524ee7 --- /dev/null +++ b/roles/bmc_reboot/molecule/default/molecule.yml @@ -0,0 +1,6 @@ +--- +platforms: + - name: instance + # you might want to add your own variables here based on what provisioning + # you are doing like: + # image: quay.io/centos/centos:stream8 diff --git a/roles/bmc_reboot/tasks/main.yml b/roles/bmc_reboot/tasks/main.yml new file mode 100644 index 0000000..812eb30 --- /dev/null +++ b/roles/bmc_reboot/tasks/main.yml @@ -0,0 +1,2 @@ +--- +# tasks file for bmc_reboot diff --git a/roles/bmc_reboot/tests/inventory b/roles/bmc_reboot/tests/inventory new file mode 100644 index 0000000..878877b --- /dev/null +++ b/roles/bmc_reboot/tests/inventory @@ -0,0 +1,2 @@ +localhost + diff --git a/roles/bmc_reboot/tests/test.yml b/roles/bmc_reboot/tests/test.yml new file mode 100644 index 0000000..c3bad8d --- /dev/null +++ b/roles/bmc_reboot/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + remote_user: root + roles: + - bmc_reboot diff --git a/roles/bmc_reboot/vars/main.yml b/roles/bmc_reboot/vars/main.yml new file mode 100644 index 0000000..9a5a7e4 --- /dev/null +++ b/roles/bmc_reboot/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for bmc_reboot diff --git a/roles/enable_secure_boot/README.md b/roles/enable_secure_boot/README.md new file mode 100644 index 0000000..225dd44 --- /dev/null +++ b/roles/enable_secure_boot/README.md @@ -0,0 +1,38 @@ +Role Name +========= + +A brief description of the role goes here. + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/enable_secure_boot/defaults/main.yml b/roles/enable_secure_boot/defaults/main.yml new file mode 100644 index 0000000..408041d --- /dev/null +++ b/roles/enable_secure_boot/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for enable_secure_boot diff --git a/roles/enable_secure_boot/handlers/main.yml b/roles/enable_secure_boot/handlers/main.yml new file mode 100644 index 0000000..194b4c2 --- /dev/null +++ b/roles/enable_secure_boot/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for enable_secure_boot diff --git a/roles/enable_secure_boot/meta/main.yml b/roles/enable_secure_boot/meta/main.yml new file mode 100644 index 0000000..c572acc --- /dev/null +++ b/roles/enable_secure_boot/meta/main.yml @@ -0,0 +1,52 @@ +galaxy_info: + author: your name + description: your role description + company: your company (optional) + + # If the issue tracker for your role is not on github, uncomment the + # next line and provide a value + # issue_tracker_url: http://example.com/issue/tracker + + # Choose a valid license ID from https://spdx.org - some suggested licenses: + # - BSD-3-Clause (default) + # - MIT + # - GPL-2.0-or-later + # - GPL-3.0-only + # - Apache-2.0 + # - CC-BY-4.0 + license: license (GPL-2.0-or-later, MIT, etc) + + min_ansible_version: 2.1 + + # If this a Container Enabled role, provide the minimum Ansible Container version. + # min_ansible_container_version: + + # + # Provide a list of supported platforms, and for each platform a list of versions. + # If you don't wish to enumerate all versions for a particular platform, use 'all'. + # To view available platforms and versions (or releases), visit: + # https://galaxy.ansible.com/api/v1/platforms/ + # + # platforms: + # - name: Fedora + # versions: + # - all + # - 25 + # - name: SomePlatform + # versions: + # - all + # - 1.0 + # - 7 + # - 99.99 + + galaxy_tags: [] + # List tags for your role here, one per line. A tag is a keyword that describes + # and categorizes the role. Users find roles by searching for tags. Be sure to + # remove the '[]' above, if you add tags to this list. + # + # NOTE: A tag is limited to a single word comprised of alphanumeric characters. + # Maximum 20 tags per role. + +dependencies: [] + # List your role dependencies here, one per line. Be sure to remove the '[]' above, + # if you add dependencies to this list. diff --git a/roles/enable_secure_boot/molecule/default/converge.yml b/roles/enable_secure_boot/molecule/default/converge.yml new file mode 100644 index 0000000..e600756 --- /dev/null +++ b/roles/enable_secure_boot/molecule/default/converge.yml @@ -0,0 +1,8 @@ +--- +- name: Converge + hosts: all + gather_facts: false + tasks: + - name: Replace this task with one that validates your content + ansible.builtin.debug: + msg: "This is the effective test" diff --git a/roles/enable_secure_boot/molecule/default/create.yml b/roles/enable_secure_boot/molecule/default/create.yml new file mode 100644 index 0000000..fcd6b92 --- /dev/null +++ b/roles/enable_secure_boot/molecule/default/create.yml @@ -0,0 +1,35 @@ +--- +- name: Create + hosts: localhost + connection: local + gather_facts: false + # no_log: "{{ molecule_no_log }}" + tasks: + # TODO: Developer must implement and populate 'server' variable + + - name: Create instance config + when: server.changed | default(false) | bool # noqa no-handler + block: + - name: Populate instance config dict # noqa jinja + ansible.builtin.set_fact: + instance_conf_dict: {} + # instance': "{{ }}", + # address': "{{ }}", + # user': "{{ }}", + # port': "{{ }}", + # 'identity_file': "{{ }}", } + with_items: "{{ server.results }}" + register: instance_config_dict + + - name: Convert instance config dict to a list + ansible.builtin.set_fact: + instance_conf: "{{ instance_config_dict.results | map(attribute='ansible_facts.instance_conf_dict') | list }}" + + - name: Dump instance config + ansible.builtin.copy: + content: | + # Molecule managed + + {{ instance_conf | to_json | from_json | to_yaml }} + dest: "{{ molecule_instance_config }}" + mode: "0600" diff --git a/roles/enable_secure_boot/molecule/default/destroy.yml b/roles/enable_secure_boot/molecule/default/destroy.yml new file mode 100644 index 0000000..59d6a8e --- /dev/null +++ b/roles/enable_secure_boot/molecule/default/destroy.yml @@ -0,0 +1,24 @@ +--- +- name: Destroy + hosts: localhost + connection: local + gather_facts: false + # no_log: "{{ molecule_no_log }}" + tasks: + # Developer must implement. + + # Mandatory configuration for Molecule to function. + + - name: Populate instance config + ansible.builtin.set_fact: + instance_conf: {} + + - name: Dump instance config + ansible.builtin.copy: + content: | + # Molecule managed + + {{ instance_conf | to_json | from_json | to_yaml }} + dest: "{{ molecule_instance_config }}" + mode: "0600" + when: server.changed | default(false) | bool # noqa no-handler diff --git a/roles/enable_secure_boot/molecule/default/molecule.yml b/roles/enable_secure_boot/molecule/default/molecule.yml new file mode 100644 index 0000000..b524ee7 --- /dev/null +++ b/roles/enable_secure_boot/molecule/default/molecule.yml @@ -0,0 +1,6 @@ +--- +platforms: + - name: instance + # you might want to add your own variables here based on what provisioning + # you are doing like: + # image: quay.io/centos/centos:stream8 diff --git a/roles/enable_secure_boot/tasks/main.yml b/roles/enable_secure_boot/tasks/main.yml new file mode 100644 index 0000000..c76bd11 --- /dev/null +++ b/roles/enable_secure_boot/tasks/main.yml @@ -0,0 +1,2 @@ +--- +# tasks file for enable_secure_boot diff --git a/roles/enable_secure_boot/tests/inventory b/roles/enable_secure_boot/tests/inventory new file mode 100644 index 0000000..878877b --- /dev/null +++ b/roles/enable_secure_boot/tests/inventory @@ -0,0 +1,2 @@ +localhost + diff --git a/roles/enable_secure_boot/tests/test.yml b/roles/enable_secure_boot/tests/test.yml new file mode 100644 index 0000000..2114c99 --- /dev/null +++ b/roles/enable_secure_boot/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + remote_user: root + roles: + - enable_secure_boot diff --git a/roles/enable_secure_boot/vars/main.yml b/roles/enable_secure_boot/vars/main.yml new file mode 100644 index 0000000..bb45bb1 --- /dev/null +++ b/roles/enable_secure_boot/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for enable_secure_boot diff --git a/roles/get_bmc_facts/README.md b/roles/get_bmc_facts/README.md new file mode 100644 index 0000000..225dd44 --- /dev/null +++ b/roles/get_bmc_facts/README.md @@ -0,0 +1,38 @@ +Role Name +========= + +A brief description of the role goes here. + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/get_bmc_facts/defaults/main.yml b/roles/get_bmc_facts/defaults/main.yml new file mode 100644 index 0000000..78f080a --- /dev/null +++ b/roles/get_bmc_facts/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for get_bmc_facts diff --git a/roles/get_bmc_facts/handlers/main.yml b/roles/get_bmc_facts/handlers/main.yml new file mode 100644 index 0000000..f3c5f36 --- /dev/null +++ b/roles/get_bmc_facts/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for get_bmc_facts diff --git a/roles/get_bmc_facts/meta/main.yml b/roles/get_bmc_facts/meta/main.yml new file mode 100644 index 0000000..c572acc --- /dev/null +++ b/roles/get_bmc_facts/meta/main.yml @@ -0,0 +1,52 @@ +galaxy_info: + author: your name + description: your role description + company: your company (optional) + + # If the issue tracker for your role is not on github, uncomment the + # next line and provide a value + # issue_tracker_url: http://example.com/issue/tracker + + # Choose a valid license ID from https://spdx.org - some suggested licenses: + # - BSD-3-Clause (default) + # - MIT + # - GPL-2.0-or-later + # - GPL-3.0-only + # - Apache-2.0 + # - CC-BY-4.0 + license: license (GPL-2.0-or-later, MIT, etc) + + min_ansible_version: 2.1 + + # If this a Container Enabled role, provide the minimum Ansible Container version. + # min_ansible_container_version: + + # + # Provide a list of supported platforms, and for each platform a list of versions. + # If you don't wish to enumerate all versions for a particular platform, use 'all'. + # To view available platforms and versions (or releases), visit: + # https://galaxy.ansible.com/api/v1/platforms/ + # + # platforms: + # - name: Fedora + # versions: + # - all + # - 25 + # - name: SomePlatform + # versions: + # - all + # - 1.0 + # - 7 + # - 99.99 + + galaxy_tags: [] + # List tags for your role here, one per line. A tag is a keyword that describes + # and categorizes the role. Users find roles by searching for tags. Be sure to + # remove the '[]' above, if you add tags to this list. + # + # NOTE: A tag is limited to a single word comprised of alphanumeric characters. + # Maximum 20 tags per role. + +dependencies: [] + # List your role dependencies here, one per line. Be sure to remove the '[]' above, + # if you add dependencies to this list. diff --git a/roles/get_bmc_facts/molecule/default/converge.yml b/roles/get_bmc_facts/molecule/default/converge.yml new file mode 100644 index 0000000..e600756 --- /dev/null +++ b/roles/get_bmc_facts/molecule/default/converge.yml @@ -0,0 +1,8 @@ +--- +- name: Converge + hosts: all + gather_facts: false + tasks: + - name: Replace this task with one that validates your content + ansible.builtin.debug: + msg: "This is the effective test" diff --git a/roles/get_bmc_facts/molecule/default/create.yml b/roles/get_bmc_facts/molecule/default/create.yml new file mode 100644 index 0000000..fcd6b92 --- /dev/null +++ b/roles/get_bmc_facts/molecule/default/create.yml @@ -0,0 +1,35 @@ +--- +- name: Create + hosts: localhost + connection: local + gather_facts: false + # no_log: "{{ molecule_no_log }}" + tasks: + # TODO: Developer must implement and populate 'server' variable + + - name: Create instance config + when: server.changed | default(false) | bool # noqa no-handler + block: + - name: Populate instance config dict # noqa jinja + ansible.builtin.set_fact: + instance_conf_dict: {} + # instance': "{{ }}", + # address': "{{ }}", + # user': "{{ }}", + # port': "{{ }}", + # 'identity_file': "{{ }}", } + with_items: "{{ server.results }}" + register: instance_config_dict + + - name: Convert instance config dict to a list + ansible.builtin.set_fact: + instance_conf: "{{ instance_config_dict.results | map(attribute='ansible_facts.instance_conf_dict') | list }}" + + - name: Dump instance config + ansible.builtin.copy: + content: | + # Molecule managed + + {{ instance_conf | to_json | from_json | to_yaml }} + dest: "{{ molecule_instance_config }}" + mode: "0600" diff --git a/roles/get_bmc_facts/molecule/default/destroy.yml b/roles/get_bmc_facts/molecule/default/destroy.yml new file mode 100644 index 0000000..59d6a8e --- /dev/null +++ b/roles/get_bmc_facts/molecule/default/destroy.yml @@ -0,0 +1,24 @@ +--- +- name: Destroy + hosts: localhost + connection: local + gather_facts: false + # no_log: "{{ molecule_no_log }}" + tasks: + # Developer must implement. + + # Mandatory configuration for Molecule to function. + + - name: Populate instance config + ansible.builtin.set_fact: + instance_conf: {} + + - name: Dump instance config + ansible.builtin.copy: + content: | + # Molecule managed + + {{ instance_conf | to_json | from_json | to_yaml }} + dest: "{{ molecule_instance_config }}" + mode: "0600" + when: server.changed | default(false) | bool # noqa no-handler diff --git a/roles/get_bmc_facts/molecule/default/molecule.yml b/roles/get_bmc_facts/molecule/default/molecule.yml new file mode 100644 index 0000000..b524ee7 --- /dev/null +++ b/roles/get_bmc_facts/molecule/default/molecule.yml @@ -0,0 +1,6 @@ +--- +platforms: + - name: instance + # you might want to add your own variables here based on what provisioning + # you are doing like: + # image: quay.io/centos/centos:stream8 diff --git a/roles/get_bmc_facts/tasks/main.yml b/roles/get_bmc_facts/tasks/main.yml new file mode 100644 index 0000000..e77ab00 --- /dev/null +++ b/roles/get_bmc_facts/tasks/main.yml @@ -0,0 +1,2 @@ +--- +# tasks file for get_bmc_facts diff --git a/roles/get_bmc_facts/tests/inventory b/roles/get_bmc_facts/tests/inventory new file mode 100644 index 0000000..878877b --- /dev/null +++ b/roles/get_bmc_facts/tests/inventory @@ -0,0 +1,2 @@ +localhost + diff --git a/roles/get_bmc_facts/tests/test.yml b/roles/get_bmc_facts/tests/test.yml new file mode 100644 index 0000000..aa4ead0 --- /dev/null +++ b/roles/get_bmc_facts/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + remote_user: root + roles: + - get_bmc_facts diff --git a/roles/get_bmc_facts/vars/main.yml b/roles/get_bmc_facts/vars/main.yml new file mode 100644 index 0000000..f96fb47 --- /dev/null +++ b/roles/get_bmc_facts/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for get_bmc_facts diff --git a/roles/update_bmc_password/README.md b/roles/update_bmc_password/README.md new file mode 100644 index 0000000..225dd44 --- /dev/null +++ b/roles/update_bmc_password/README.md @@ -0,0 +1,38 @@ +Role Name +========= + +A brief description of the role goes here. + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/update_bmc_password/defaults/main.yml b/roles/update_bmc_password/defaults/main.yml new file mode 100644 index 0000000..f02d4fd --- /dev/null +++ b/roles/update_bmc_password/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for update_bmc_password diff --git a/roles/update_bmc_password/handlers/main.yml b/roles/update_bmc_password/handlers/main.yml new file mode 100644 index 0000000..125f99a --- /dev/null +++ b/roles/update_bmc_password/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for update_bmc_password diff --git a/roles/update_bmc_password/meta/main.yml b/roles/update_bmc_password/meta/main.yml new file mode 100644 index 0000000..c572acc --- /dev/null +++ b/roles/update_bmc_password/meta/main.yml @@ -0,0 +1,52 @@ +galaxy_info: + author: your name + description: your role description + company: your company (optional) + + # If the issue tracker for your role is not on github, uncomment the + # next line and provide a value + # issue_tracker_url: http://example.com/issue/tracker + + # Choose a valid license ID from https://spdx.org - some suggested licenses: + # - BSD-3-Clause (default) + # - MIT + # - GPL-2.0-or-later + # - GPL-3.0-only + # - Apache-2.0 + # - CC-BY-4.0 + license: license (GPL-2.0-or-later, MIT, etc) + + min_ansible_version: 2.1 + + # If this a Container Enabled role, provide the minimum Ansible Container version. + # min_ansible_container_version: + + # + # Provide a list of supported platforms, and for each platform a list of versions. + # If you don't wish to enumerate all versions for a particular platform, use 'all'. + # To view available platforms and versions (or releases), visit: + # https://galaxy.ansible.com/api/v1/platforms/ + # + # platforms: + # - name: Fedora + # versions: + # - all + # - 25 + # - name: SomePlatform + # versions: + # - all + # - 1.0 + # - 7 + # - 99.99 + + galaxy_tags: [] + # List tags for your role here, one per line. A tag is a keyword that describes + # and categorizes the role. Users find roles by searching for tags. Be sure to + # remove the '[]' above, if you add tags to this list. + # + # NOTE: A tag is limited to a single word comprised of alphanumeric characters. + # Maximum 20 tags per role. + +dependencies: [] + # List your role dependencies here, one per line. Be sure to remove the '[]' above, + # if you add dependencies to this list. diff --git a/roles/update_bmc_password/molecule/default/converge.yml b/roles/update_bmc_password/molecule/default/converge.yml new file mode 100644 index 0000000..e600756 --- /dev/null +++ b/roles/update_bmc_password/molecule/default/converge.yml @@ -0,0 +1,8 @@ +--- +- name: Converge + hosts: all + gather_facts: false + tasks: + - name: Replace this task with one that validates your content + ansible.builtin.debug: + msg: "This is the effective test" diff --git a/roles/update_bmc_password/molecule/default/create.yml b/roles/update_bmc_password/molecule/default/create.yml new file mode 100644 index 0000000..fcd6b92 --- /dev/null +++ b/roles/update_bmc_password/molecule/default/create.yml @@ -0,0 +1,35 @@ +--- +- name: Create + hosts: localhost + connection: local + gather_facts: false + # no_log: "{{ molecule_no_log }}" + tasks: + # TODO: Developer must implement and populate 'server' variable + + - name: Create instance config + when: server.changed | default(false) | bool # noqa no-handler + block: + - name: Populate instance config dict # noqa jinja + ansible.builtin.set_fact: + instance_conf_dict: {} + # instance': "{{ }}", + # address': "{{ }}", + # user': "{{ }}", + # port': "{{ }}", + # 'identity_file': "{{ }}", } + with_items: "{{ server.results }}" + register: instance_config_dict + + - name: Convert instance config dict to a list + ansible.builtin.set_fact: + instance_conf: "{{ instance_config_dict.results | map(attribute='ansible_facts.instance_conf_dict') | list }}" + + - name: Dump instance config + ansible.builtin.copy: + content: | + # Molecule managed + + {{ instance_conf | to_json | from_json | to_yaml }} + dest: "{{ molecule_instance_config }}" + mode: "0600" diff --git a/roles/update_bmc_password/molecule/default/destroy.yml b/roles/update_bmc_password/molecule/default/destroy.yml new file mode 100644 index 0000000..59d6a8e --- /dev/null +++ b/roles/update_bmc_password/molecule/default/destroy.yml @@ -0,0 +1,24 @@ +--- +- name: Destroy + hosts: localhost + connection: local + gather_facts: false + # no_log: "{{ molecule_no_log }}" + tasks: + # Developer must implement. + + # Mandatory configuration for Molecule to function. + + - name: Populate instance config + ansible.builtin.set_fact: + instance_conf: {} + + - name: Dump instance config + ansible.builtin.copy: + content: | + # Molecule managed + + {{ instance_conf | to_json | from_json | to_yaml }} + dest: "{{ molecule_instance_config }}" + mode: "0600" + when: server.changed | default(false) | bool # noqa no-handler diff --git a/roles/update_bmc_password/molecule/default/molecule.yml b/roles/update_bmc_password/molecule/default/molecule.yml new file mode 100644 index 0000000..b524ee7 --- /dev/null +++ b/roles/update_bmc_password/molecule/default/molecule.yml @@ -0,0 +1,6 @@ +--- +platforms: + - name: instance + # you might want to add your own variables here based on what provisioning + # you are doing like: + # image: quay.io/centos/centos:stream8 diff --git a/roles/update_bmc_password/tasks/main.yml b/roles/update_bmc_password/tasks/main.yml new file mode 100644 index 0000000..2c7f454 --- /dev/null +++ b/roles/update_bmc_password/tasks/main.yml @@ -0,0 +1,2 @@ +--- +# tasks file for update_bmc_password diff --git a/roles/update_bmc_password/tests/inventory b/roles/update_bmc_password/tests/inventory new file mode 100644 index 0000000..878877b --- /dev/null +++ b/roles/update_bmc_password/tests/inventory @@ -0,0 +1,2 @@ +localhost + diff --git a/roles/update_bmc_password/tests/test.yml b/roles/update_bmc_password/tests/test.yml new file mode 100644 index 0000000..74492d5 --- /dev/null +++ b/roles/update_bmc_password/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + remote_user: root + roles: + - update_bmc_password diff --git a/roles/update_bmc_password/vars/main.yml b/roles/update_bmc_password/vars/main.yml new file mode 100644 index 0000000..e48e6bc --- /dev/null +++ b/roles/update_bmc_password/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for update_bmc_password