Initial collection structure

Migrated from legacy playbook repo into Ansible collection format:

Roles (171 total):
- common: 44 roles (fact gathering, SSH setup, utilities)
- configuration: 32 roles (system config, networking, satellite)
- provisioning: 16 roles (VMware, Azure, physical server deployment)
- security: 15 roles (OpenSCAP hardening, certificates, AD integration)
- monitoring: 12 roles (Zabbix, logging agents, metrics)
- networking: 12 roles (DNS, DHCP, network interfaces)
- satellite: 4 roles (Pulp/Satellite management)
- misc: 36 roles (various utilities)

Playbooks (159 total):
- provisioning: 14 playbooks
- azure: 13 playbooks
- configuration: 22 playbooks
- maintenance: 10 playbooks
- security: 10 playbooks
- monitoring: 9 playbooks
- vcenter: 6 playbooks
- networking: 7 playbooks
- misc: 65 playbooks
This commit is contained in:
2026-06-27 21:48:22 +02:00
commit a3b8959ca9
1825 changed files with 79105 additions and 0 deletions

View File

@@ -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
------------------
Created by the UFST Linux team

View File

@@ -0,0 +1,2 @@
---
# defaults file for azure-compare-ip

View File

@@ -0,0 +1,2 @@
---
# handlers file for azure-compare-ip

View File

@@ -0,0 +1,57 @@
galaxy_info:
author: your name
description: your 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
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)
min_ansible_version: 1.2
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
# Optionally specify the branch Galaxy will use when accessing the GitHub
# repo for this role. During role install, if no tags are available,
# Galaxy will use this branch. During import Galaxy will access files on
# this branch. If Travis integration is configured, only notifications for this
# branch will be accepted. Otherwise, in all cases, the repo's default branch
# (usually master) will be used.
#github_branch:
#
# platforms is a list of platforms, and each platform has a name and a list of versions.
#
# 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.

View File

@@ -0,0 +1,7 @@
---
# Verification task for azure provision playbooks validating the azure provided IP against the resolved ip
- name: DNS resolves to Azure provided IP
assert:
that:
- "'{{ resolved_ip }}' == '{{ vm_ip | default(ip) }}'"
msg: "DNS name does not resolve to {{ vm_ip | default(ip) }}"

View File

@@ -0,0 +1,2 @@
localhost

View File

@@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- azure-compare-ip

View File

@@ -0,0 +1,2 @@
---
# vars file for azure-compare-ip

View File

@@ -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
------------------
Created by the UFST Linux team

View File

@@ -0,0 +1,2 @@
---
# defaults file for azure-get-ip

View File

@@ -0,0 +1,2 @@
---
# handlers file for azure-get-ip

View File

@@ -0,0 +1,57 @@
galaxy_info:
author: your name
description: your 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
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)
min_ansible_version: 1.2
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
# Optionally specify the branch Galaxy will use when accessing the GitHub
# repo for this role. During role install, if no tags are available,
# Galaxy will use this branch. During import Galaxy will access files on
# this branch. If Travis integration is configured, only notifications for this
# branch will be accepted. Otherwise, in all cases, the repo's default branch
# (usually master) will be used.
#github_branch:
#
# platforms is a list of platforms, and each platform has a name and a list of versions.
#
# 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.

View File

@@ -0,0 +1,14 @@
---
- name: Get network interface facts
azure_rm_networkinterface_facts:
resource_group: "{{ tapi_resource_group }}"
name: "{{ vm_name | default (inventory_hostname)}}"
register: nic_facts
- name: Set IP address fact
set_fact:
vm_ip: "{{ nic_facts.ansible_facts.azure_networkinterfaces[0].properties.ipConfigurations[0].properties.privateIPAddress }}"
- debug:
msg: "{{ vm_ip }}"

View File

@@ -0,0 +1,2 @@
localhost

View File

@@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- azure-get-ip

View File

@@ -0,0 +1,2 @@
---
# vars file for azure-get-ip

View File

@@ -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
------------------
Created by the UFST Linux team

View File

@@ -0,0 +1,2 @@
---
# defaults file for change-ip-address

View File

@@ -0,0 +1,2 @@
---
# handlers file for change-ip-address

View File

@@ -0,0 +1,57 @@
galaxy_info:
author: your name
description: your 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
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)
min_ansible_version: 1.2
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
# Optionally specify the branch Galaxy will use when accessing the GitHub
# repo for this role. During role install, if no tags are available,
# Galaxy will use this branch. During import Galaxy will access files on
# this branch. If Travis integration is configured, only notifications for this
# branch will be accepted. Otherwise, in all cases, the repo's default branch
# (usually master) will be used.
#github_branch:
#
# platforms is a list of platforms, and each platform has a name and a list of versions.
#
# 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.

View File

@@ -0,0 +1,19 @@
---
- name: Get the current IP
shell: nmcli connection show '{{ interface | default("ens192") }}' | grep "ipv4.addresses:" | awk '{ print substr($2, 0, index($2, "/")-1)}'
register: current_ip
changed_when: False
- name: Current IP
debug: msg={{ current_ip.stdout }}
- name: Set the new IP
command: nmcli con mod '{{ interface | default("ens192") }}' ipv4.address {{ new_ip }}/{{ new_ip_cidr}}
when: "current_ip.stdout != new_ip"
- name: Restart network
systemd:
name: network
state: restarted
no_block: True
when: "current_ip.stdout != new_ip"

View File

@@ -0,0 +1,2 @@
localhost

View File

@@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- change-ip-address

View File

@@ -0,0 +1,2 @@
---
# vars file for change-ip-address

View File

@@ -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
------------------
Created by the UFST Linux team

View File

@@ -0,0 +1,2 @@
---
# defaults file for check-dns-name

View File

@@ -0,0 +1,2 @@
---
# handlers file for check-dns-name

View File

@@ -0,0 +1,57 @@
galaxy_info:
author: your name
description: your 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
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)
min_ansible_version: 1.2
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
# Optionally specify the branch Galaxy will use when accessing the GitHub
# repo for this role. During role install, if no tags are available,
# Galaxy will use this branch. During import Galaxy will access files on
# this branch. If Travis integration is configured, only notifications for this
# branch will be accepted. Otherwise, in all cases, the repo's default branch
# (usually master) will be used.
#github_branch:
#
# platforms is a list of platforms, and each platform has a name and a list of versions.
#
# 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.

View File

@@ -0,0 +1,17 @@
---
- debug: msg={{ hostname | default(inventory_hostname) }}
- name: Verify that DNS record exists
command: "ssh {{ jump_host }} 'dig +short {{ hostname | default(inventory_hostname) }}'"
delegate_to: localhost
ignore_errors: True
register: dns_lookup
until: dns_lookup.stdout != ''
retries: 15
delay: 10
- name: Set resolved ip fact
set_fact:
resolved_ip: "{{ dns_lookup.stdout }}"
- debug: msg="IP resolved to {{ resolved_ip }}"

View File

@@ -0,0 +1,2 @@
localhost

View File

@@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- check-dns-name

View File

@@ -0,0 +1,2 @@
---
# vars file for check-dns-name

View File

@@ -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
------------------
Created by the UFST Linux team

View File

@@ -0,0 +1,2 @@
---
# defaults file for clear-host-from-known-hosts

View File

@@ -0,0 +1,2 @@
---
# handlers file for clear-host-from-known-hosts

View File

@@ -0,0 +1,57 @@
galaxy_info:
author: your name
description: your 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
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)
min_ansible_version: 1.2
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
# Optionally specify the branch Galaxy will use when accessing the GitHub
# repo for this role. During role install, if no tags are available,
# Galaxy will use this branch. During import Galaxy will access files on
# this branch. If Travis integration is configured, only notifications for this
# branch will be accepted. Otherwise, in all cases, the repo's default branch
# (usually master) will be used.
#github_branch:
#
# platforms is a list of platforms, and each platform has a name and a list of versions.
#
# 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.

View File

@@ -0,0 +1,13 @@
---
# tasks file for clear-host-from-known-hosts
- name: Remove {{ inventory_hostname }} from hosts file
lineinfile:
path: "{{ ansible_env.HOME }}/.ssh/known_hosts"
regexp: "^{{ inventory_hostname }}.*"
state: absent
- name: Remove {{ inventory_hostname.split(".")[0] }}
lineinfile:
path: "{{ ansible_env.HOME }}/.ssh/known_hosts"
regexp: "^{{ inventory_hostname.split('.')[0] }}.*"
state: absent

View File

@@ -0,0 +1,2 @@
localhost

View File

@@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- clear-host-from-known-hosts

View File

@@ -0,0 +1,2 @@
---
# vars file for clear-host-from-known-hosts

View File

@@ -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
------------------
Created by the UFST Linux team

View File

@@ -0,0 +1,2 @@
---
# defaults file for create-dhcp-reservation

View File

@@ -0,0 +1,2 @@
---
# handlers file for create-dhcp-reservation

View File

@@ -0,0 +1,60 @@
galaxy_info:
author: your name
description: your 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
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)
min_ansible_version: 2.4
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
# Optionally specify the branch Galaxy will use when accessing the GitHub
# repo for this role. During role install, if no tags are available,
# Galaxy will use this branch. During import Galaxy will access files on
# this branch. If Travis integration is configured, only notifications for this
# branch will be accepted. Otherwise, in all cases, the repo's default branch
# (usually master) will be used.
#github_branch:
#
# 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.

View File

@@ -0,0 +1,67 @@
---
- name: Define z23 jump host
ansible.builtin.set_fact:
linux_server: "z23ljump.DMZ23.EXAMPLE.COM"
when: dc_domain == 'DMZ23.EXAMPLE.COM'
- name: Define z24 jump host
ansible.builtin.set_fact:
linux_server: "z24ljump.DMZ.EXAMPLE.COM"
when: dc_domain == 'DMZ.EXAMPLE.COM'
- name: Define ccta jump host
ansible.builtin.set_fact:
linux_server: "ljump.EXAMPLE-CORP.COM"
when: dc_domain == 'EXAMPLE-CORP.COM'
- name: Define windows server
ansible.builtin.set_fact:
windows_server: "lwinjump01.EXAMPLE-CORP.COM"
- name: fetch list of used IP's from windows server
ansible.windows.win_shell: |
powershell.exe -ExecutionPolicy ByPass -Command 'Get-DhcpServerv4Reservation -ComputerName dhcp03.EXAMPLE-CORP.COM -ScopeId "{{ subnet | regex_replace( '\/.*$', '') }}" | Select-Object -ExpandProperty 'IPAddress' | Select -ExpandProperty IPAddressToString'
delegate_to: "{{ windows_server }}"
vars:
ansible_user: "{{ service_user_ccta }}"
ansible_password: "{{ schrodingers_password }}"
ansible_connection: ssh
ansible_shell_type: powershell
register: taken_ip
- name: set output to just ip list
ansible.builtin.set_fact:
taken_ip: "{{ taken_ip.stdout_lines }}"
- name: fetch list of all IP's from local linux server
ansible.builtin.shell: cat /etc/hostname && nmap -sL -n {{ subnet }} | awk '/Nmap scan report/{print $NF}' | grep -Ev '\.(0|1|255)$'
args:
executable: /bin/bash
register: all_ip
delegate_to: "{{ linux_server }}"
- name: set list of all IPs
ansible.builtin.set_fact:
all_ip: "{{ all_ip.stdout_lines }}"
- name: compare checklist with list of all available IPs and register list of available
ansible.builtin.set_fact:
available_ip: "{{ all_ip | difference(taken_ip) }}"
- name: return an available IP address
ansible.builtin.set_fact:
available_ip: "{{ available_ip[:10] | random }}"
- name: assign IP to MAC address
ansible.windows.win_shell: |
powershell.exe -ExecutionPolicy ByPass -Command 'Add-DhcpServerv4Reservation -ComputerName dhcp03.EXAMPLE-CORP.COM -ScopeId "{{ subnet | regex_replace('\/.*$', '') }}" -IPAddress "{{ available_ip }}" -ClientId "{{ vm_mac | regex_replace(':', '-' ) }}" -Description "{{ inventory_hostname }}" -Name "{{ inventory_hostname }}"'
delegate_to: "{{ windows_server }}"
vars:
ansible_user: "{{ service_user_ccta }}"
ansible_password: "{{ schrodingers_password }}"
ansible_connection: ssh
ansible_shell_type: powershell
- name: Assign available_ip to tapi fact
ansible.builtin.set_fact:
tapi_ip: "{{ available_ip }}"

View File

@@ -0,0 +1,2 @@
localhost

View File

@@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- create-dhcp-reservation

View File

@@ -0,0 +1,2 @@
---
# vars file for create-dhcp-reservation

View File

@@ -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
------------------
Created by the UFST Linux team

View File

@@ -0,0 +1,17 @@
---
# defaults file for create-dns-record
schrodingers_password: !vault |
$ANSIBLE_VAULT;1.2.6;AES256
REDACTED_FOR_PUBLIC_SHARING
service_user_dmz23: !vault |
$ANSIBLE_VAULT;1.2.6;AES256
REDACTED_FOR_PUBLIC_SHARING
service_user_dmz24: !vault |
$ANSIBLE_VAULT;1.2.6;AES256
REDACTED_FOR_PUBLIC_SHARING
service_user_ccta: !vault |
$ANSIBLE_VAULT;1.2.6;AES256
REDACTED_FOR_PUBLIC_SHARING

View File

@@ -0,0 +1,2 @@
---
# handlers file for create-dns-record

View File

@@ -0,0 +1,60 @@
galaxy_info:
author: your name
description: your 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
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)
min_ansible_version: 2.4
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
# Optionally specify the branch Galaxy will use when accessing the GitHub
# repo for this role. During role install, if no tags are available,
# Galaxy will use this branch. During import Galaxy will access files on
# this branch. If Travis integration is configured, only notifications for this
# branch will be accepted. Otherwise, in all cases, the repo's default branch
# (usually master) will be used.
#github_branch:
#
# 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.

View File

@@ -0,0 +1,41 @@
---
- name: Set jump host and DNS server
set_fact:
dns_server: "hocdc03.EXAMPLE-CORP.COM"
when: dc_domain == 'EXAMPLE-CORP.COM'
- name: Set hostname fact
ansible.builtin.set_fact:
server_hostname: '{{ inventory_hostname.split(".")[0] | lower }}'
- name: Create A record for {{ inventory_hostname }}
community.windows.win_dns_record:
name: "{{ server_hostname }}"
type: "A"
values: "{{ tapi_ip }}"
state: present
zone: "{{ dc_domain }}"
computer_name: "{{ dns_server }}"
delegate_to: "{{ winjump_host }}"
vars:
ansible_user: "{{ service_user_dmz24 }}"
ansible_password: "{{ schrodingers_password }}"
ansible_connection: ssh
ansible_shell_type: powershell
when: tapi_ip is defined and winjump_host != 'unknown' and dns_server != 'unknown'
- name: Create PTR record for {{ inventory_hostname }}
community.windows.win_dns_record:
name: "{{ tapi_ip }}"
type: "PTR"
values: "{{ server_hostname }}"
state: present
zone: "{{ dc_domain }}"
computer_name: "{{ dns_server }}"
delegate_to: "{{ winjump_host }}"
vars:
ansible_user: "{{ service_user_dmz24 }}"
ansible_password: "{{ schrodingers_password }}"
ansible_connection: ssh
ansible_shell_type: powershell
when: tapi_ip is defined and winjump_host != 'unknown' and dns_server != 'unknown'

View File

@@ -0,0 +1,41 @@
---
- name: Set jump host and DNS server
set_fact:
dns_server: "z23addc03.DMZ23.EXAMPLE.COM"
when: dc_domain == 'DMZ23.EXAMPLE.COM'
- name: Set hostname fact
ansible.builtin.set_fact:
server_hostname: '{{ inventory_hostname.split(".")[0] | lower }}'
- name: Create A record for {{ inventory_hostname }}
community.windows.win_dns_record:
name: "{{ server_hostname }}"
type: "A"
values: "{{ tapi_ip }}"
state: present
zone: "{{ dc_domain }}"
computer_name: "{{ dns_server }}"
delegate_to: "{{ winjump_host }}"
vars:
ansible_user: "{{ service_user_dmz24 }}"
ansible_password: "{{ schrodingers_password }}"
ansible_connection: ssh
ansible_shell_type: powershell
when: tapi_ip is defined and winjump_host != 'unknown' and dns_server != 'unknown'
- name: Create PTR record for {{ inventory_hostname }}
community.windows.win_dns_record:
name: "{{ tapi_ip }}"
type: "PTR"
values: "{{ server_hostname }}"
state: present
zone: "{{ dc_domain }}"
computer_name: "{{ dns_server }}"
delegate_to: "{{ winjump_host }}"
vars:
ansible_user: "{{ service_user_dmz24 }}"
ansible_password: "{{ schrodingers_password }}"
ansible_connection: ssh
ansible_shell_type: powershell
when: tapi_ip is defined and winjump_host != 'unknown' and dns_server != 'unknown'

View File

@@ -0,0 +1,41 @@
---
- name: Set jump host and DNS server
set_fact:
dns_server: "z24addc03.DMZ.EXAMPLE.COM"
when: dc_domain == 'DMZ.EXAMPLE.COM'
- name: Set hostname fact
ansible.builtin.set_fact:
server_hostname: '{{ inventory_hostname.split(".")[0] | lower }}'
- name: Create A record for {{ inventory_hostname }}
community.windows.win_dns_record:
name: "{{ server_hostname }}"
type: "A"
values: "{{ tapi_ip }}"
state: present
zone: "{{ dc_domain }}"
computer_name: "{{ dns_server }}"
delegate_to: "{{ winjump_host }}"
vars:
ansible_user: "{{ service_user_dmz24 }}"
ansible_password: "{{ schrodingers_password }}"
ansible_connection: ssh
ansible_shell_type: powershell
when: tapi_ip is defined and winjump_host != 'unknown' and dns_server != 'unknown'
- name: Create PTR record for {{ inventory_hostname }}
community.windows.win_dns_record:
name: "{{ tapi_ip }}"
type: "PTR"
values: "{{ server_hostname }}"
state: present
zone: "{{ dc_domain }}"
computer_name: "{{ dns_server }}"
delegate_to: "{{ winjump_host }}"
vars:
ansible_user: "{{ service_user_dmz24 }}"
ansible_password: "{{ schrodingers_password }}"
ansible_connection: ssh
ansible_shell_type: powershell
when: tapi_ip is defined and winjump_host != 'unknown' and dns_server != 'unknown'

View File

@@ -0,0 +1,13 @@
---
- ansible.builtin.import_tasks: ccta_create_dns.yml
when: dc_domain == 'EXAMPLE-CORP.COM'
- ansible.builtin.import_tasks: dmz23_create_dns.yml
when: dc_domain == 'DMZ23.EXAMPLE.COM'
- ansible.builtin.import_tasks: dmz24_create_dns.yml
when: dc_domain == 'DMZ.EXAMPLE.COM'
- name: Pause for 4 minutes to give the AD a chance to get the record out.
pause:
minutes: 2

View File

@@ -0,0 +1,2 @@
localhost

View File

@@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- create-dns-record

View File

@@ -0,0 +1,2 @@
---
# vars file for create-dns-record

View File

@@ -0,0 +1,29 @@
---
language: python
python: "2.7"
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
install:
# Install ansible
- pip install ansible
# Check ansible version
- ansible --version
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

View File

@@ -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
------------------
Created by the UFST Linux team

View File

@@ -0,0 +1,5 @@
---
# defaults file for realm-join
dc_domain: DMZ.EXAMPLE.COM
reinstall_realm_packages: False
datacenter: onpremise

View File

@@ -0,0 +1,5 @@
---
# handlers file for realm-join
- name: restart sssd
service: name=sssd state=restarted

View File

@@ -0,0 +1,57 @@
galaxy_info:
author: your name
description: your 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
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)
min_ansible_version: 1.2
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
# Optionally specify the branch Galaxy will use when accessing the GitHub
# repo for this role. During role install, if no tags are available,
# Galaxy will use this branch. During import Galaxy will access files on
# this branch. If Travis integration is configured, only notifications for this
# branch will be accepted. Otherwise, in all cases, the repo's default branch
# (usually master) will be used.
#github_branch:
#
# platforms is a list of platforms, and each platform has a name and a list of versions.
#
# 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.

View File

@@ -0,0 +1,27 @@
#!/usr/bin/expect -f
{% set computer_ou = '' %}
{% if dc_domain == 'EXAMPLE-CORP.COM' %}
{% set computer_ou = '--computer-ou=OU=Linux,OU=Servere,DC=ccta,DC=dk' %}
{% endif %}
{% if dc_domain == 'clcta.dk' %}
{% set computer_ou = '--computer-ou=OU=Linux,OU=Servere,DC=clcta,DC=dk' %}
{% endif %}
{% if dc_domain == 'DMZ23.EXAMPLE.COM' %}
{% set computer_ou = '--computer-ou=OU=Linux,OU=Servere,DC=dmz23,DC=local' %}
{% endif %}
{% if dc_domain == 'DMZ.EXAMPLE.COM' %}
{% set computer_ou = '--computer-ou=OU=Linux,OU=Servere,DC=dmz24,DC=local' %}
{% endif %}
spawn realm join {{ "krb5-linux.EXAMPLE-CORP.COM" if dc_domain == "EXAMPLE-CORP.COM" else dc_domain }} {{ computer_ou }} -U {{ ad_join_user }}@{{ dc_domain }} --verbose
expect "Password for {{ ad_join_user }}@{{ dc_domain}}:" { send -- "{{ ad_join_pass }}\r" }
expect " * Successfully enrolled machine in realm" { send -- "Success" }
exit 0

View File

@@ -0,0 +1,27 @@
# Configuration snippets may be placed in this directory as well
includedir /etc/krb5.conf.d/
includedir /var/lib/sss/pubconf/krb5.include.d/
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
dns_lookup_realm = false
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
rdns = false
default_ccache_name = KEYRING:persistent:%{uid}
default_realm = {{ dc_domain | upper }}
[realms]
{{ dc_domain | upper }} = {
{{ 'krb5_server = krb5-linux.EXAMPLE-CORP.COM' if datacenter == "azure" and dc_domain == "EXAMPLE-CORP.COM" else '' }}
}
[domain_realm]
{{ dc_domain }} = {{ dc_domain | upper }}
.{{ dc_domain }} = {{ dc_domain | upper }}

View File

@@ -0,0 +1,26 @@
[sssd]
domains = {{ dc_domain }}
config_file_version = 2
services = nss, pam
[domain/{{ dc_domain }}]
ad_domain = {{ dc_domain }}
krb5_realm = {{ dc_domain }}
realmd_tags = manages-system joined-with-samba
cache_credentials = True
id_provider = ad
krb5_store_password_if_offline = True
default_shell = /bin/bash
ldap_id_mapping = True
#use_fully_qualified_names = True
fallback_homedir = /home/%u@%d
access_provider = simple
ldap_use_tokengroups = False
#Setup for Dynamic DNS-updates - to prevent DNS-servers from scavenging...
dyndns_update = true
dyndns_refresh_interval = 43200
dyndns_update_ptr = true
dyndns_ttl = 3600
ad_gpo_ignore_unreadable = True

View File

@@ -0,0 +1,3 @@
%{{ linux_admin_group }} ALL=(ALL) ALL
%{{ ansible_hostname }}_sudoers ALL=(ALL) ALL
%infra ALL=(ALL) ALL

View File

@@ -0,0 +1,2 @@
localhost

View File

@@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- realm-join

View File

@@ -0,0 +1,2 @@
---
# vars file for realm-join

View File

@@ -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
------------------
Created by the UFST Linux team

View File

@@ -0,0 +1,17 @@
---
# defaults file for create-dns-record
schrodingers_password: !vault |
$ANSIBLE_VAULT;1.2.6;AES256
REDACTED_FOR_PUBLIC_SHARING
service_user_dmz23: !vault |
$ANSIBLE_VAULT;1.2.6;AES256
REDACTED_FOR_PUBLIC_SHARING
service_user_dmz24: !vault |
$ANSIBLE_VAULT;1.2.6;AES256
REDACTED_FOR_PUBLIC_SHARING
service_user_ccta: !vault |
$ANSIBLE_VAULT;1.2.6;AES256
REDACTED_FOR_PUBLIC_SHARING

View File

@@ -0,0 +1,2 @@
---
# handlers file for create-dns-record

View File

@@ -0,0 +1,60 @@
galaxy_info:
author: your name
description: your 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
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: license (GPLv2, CC-BY, etc)
min_ansible_version: 2.4
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
# Optionally specify the branch Galaxy will use when accessing the GitHub
# repo for this role. During role install, if no tags are available,
# Galaxy will use this branch. During import Galaxy will access files on
# this branch. If Travis integration is configured, only notifications for this
# branch will be accepted. Otherwise, in all cases, the repo's default branch
# (usually master) will be used.
#github_branch:
#
# 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.

View File

@@ -0,0 +1,41 @@
---
- name: Set jump host and DNS server
set_fact:
dns_server: "hocdc01.EXAMPLE-CORP.COM"
when: dc_domain == 'EXAMPLE-CORP.COM'
- name: Set hostname fact
ansible.builtin.set_fact:
server_hostname: '{{ inventory_hostname.split(".")[0] | lower }}'
- name: Removing A record for {{ inventory_hostname }}
community.windows.win_dns_record:
name: "{{ server_hostname }}"
type: "A"
values: "{{ tapi_ip }}"
state: absent
zone: "{{ dc_domain }}"
computer_name: "{{ dns_server }}"
delegate_to: "{{ winjump_host }}"
vars:
ansible_user: "{{ service_user_dmz24 }}"
ansible_password: "{{ schrodingers_password }}"
ansible_connection: ssh
ansible_shell_type: powershell
when: tapi_ip is defined and winjump_host != 'unknown' and dns_server != 'unknown'
- name: Removing PTR record for {{ inventory_hostname }}
community.windows.win_dns_record:
name: "{{ tapi_ip }}"
type: "PTR"
values: "{{ server_hostname }}"
state: absent
zone: "{{ dc_domain }}"
computer_name: "{{ dns_server }}"
delegate_to: "{{ winjump_host }}"
vars:
ansible_user: "{{ service_user_dmz24 }}"
ansible_password: "{{ schrodingers_password }}"
ansible_connection: ssh
ansible_shell_type: powershell
when: tapi_ip is defined and winjump_host != 'unknown' and dns_server != 'unknown'

View File

@@ -0,0 +1,41 @@
---
- name: Set jump host and DNS server
set_fact:
dns_server: "z23addc03.DMZ23.EXAMPLE.COM"
when: dc_domain == 'DMZ23.EXAMPLE.COM'
- name: Set hostname fact
ansible.builtin.set_fact:
server_hostname: '{{ inventory_hostname.split(".")[0] | lower }}'
- name: Removing A record for {{ inventory_hostname }}
community.windows.win_dns_record:
name: "{{ server_hostname }}"
type: "A"
values: "{{ tapi_ip }}"
state: absent
zone: "{{ dc_domain }}"
computer_name: "{{ dns_server }}"
delegate_to: "{{ winjump_host }}"
vars:
ansible_user: "{{ service_user_dmz24 }}"
ansible_password: "{{ schrodingers_password }}"
ansible_connection: ssh
ansible_shell_type: powershell
when: tapi_ip is defined and winjump_host != 'unknown' and dns_server != 'unknown'
- name: Removing PTR record for {{ inventory_hostname }}
community.windows.win_dns_record:
name: "{{ tapi_ip }}"
type: "PTR"
values: "{{ server_hostname }}"
state: absent
zone: "{{ dc_domain }}"
computer_name: "{{ dns_server }}"
delegate_to: "{{ winjump_host }}"
vars:
ansible_user: "{{ service_user_dmz24 }}"
ansible_password: "{{ schrodingers_password }}"
ansible_connection: ssh
ansible_shell_type: powershell
when: tapi_ip is defined and winjump_host != 'unknown' and dns_server != 'unknown'

View File

@@ -0,0 +1,41 @@
---
- name: Set jump host and DNS server
set_fact:
dns_server: "z24addc03.DMZ.EXAMPLE.COM"
when: dc_domain == 'DMZ.EXAMPLE.COM'
- name: Set hostname fact
ansible.builtin.set_fact:
server_hostname: '{{ inventory_hostname.split(".")[0] | lower }}'
- name: Removing A record for {{ inventory_hostname }}
community.windows.win_dns_record:
name: "{{ server_hostname }}"
type: "A"
values: "{{ tapi_ip }}"
state: absent
zone: "{{ dc_domain }}"
computer_name: "{{ dns_server }}"
delegate_to: "{{ winjump_host }}"
vars:
ansible_user: "{{ service_user_dmz24 }}"
ansible_password: "{{ schrodingers_password }}"
ansible_connection: ssh
ansible_shell_type: powershell
when: tapi_ip is defined and winjump_host != 'unknown' and dns_server != 'unknown'
- name: Removing PTR record for {{ inventory_hostname }}
community.windows.win_dns_record:
name: "{{ tapi_ip }}"
type: "PTR"
values: "{{ server_hostname }}"
state: absent
zone: "{{ dc_domain }}"
computer_name: "{{ dns_server }}"
delegate_to: "{{ winjump_host }}"
vars:
ansible_user: "{{ service_user_dmz24 }}"
ansible_password: "{{ schrodingers_password }}"
ansible_connection: ssh
ansible_shell_type: powershell
when: tapi_ip is defined and winjump_host != 'unknown' and dns_server != 'unknown'

View File

@@ -0,0 +1,10 @@
---
- ansible.builtin.import_tasks: ccta_remove_dns.yml
when: dc_domain == 'EXAMPLE-CORP.COM'
- ansible.builtin.import_tasks: dmz23_remove_dns.yml
when: dc_domain == 'DMZ23.EXAMPLE.COM'
- ansible.builtin.import_tasks: dmz24_remove_dns.yml
when: dc_domain == 'DMZ.EXAMPLE.COM'

View File

@@ -0,0 +1,2 @@
localhost

View File

@@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- create-dns-record

View File

@@ -0,0 +1,2 @@
---
# vars file for create-dns-record

View File

@@ -0,0 +1,29 @@
---
language: python
python: "2.7"
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
install:
# Install ansible
- pip install ansible
# Check ansible version
- ansible --version
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

View File

@@ -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).

View File

@@ -0,0 +1,7 @@
---
# defaults file for vmware-provision
vcenter_host: vcsa01.EXAMPLE-CORP.COM
template: RHEL9Template
cpus: 2
mem_mb: 4096
disk_gb: 60

View File

@@ -0,0 +1,2 @@
---
# handlers file for vmware_connected_network

View File

@@ -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.

View File

@@ -0,0 +1,20 @@
---
- include_vars: credentials.yml
- name: Set Network connected for VM
vmware_guest_network:
validate_certs: false
hostname: "{{ vcenter_host }}"
username: "{{ vmware_user }}"
password: "{{ vmware_pass }}"
datacenter: "{{ vmware_datacenter }}"
name: "{{ vm_name | default (inventory_hostname) }}"
network_name: "{{ tapi_aci_network }}"
connected: true
start_connected: true
register: set_vm_network
- name: Sleep for 10 seconds and continue with play
ansible.builtin.wait_for:
timeout: 10
delegate_to: localhost

View File

@@ -0,0 +1,2 @@
localhost

View File

@@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- vmware_connected_network

View File

@@ -0,0 +1,29 @@
---
language: python
python: "2.7"
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
install:
# Install ansible
- pip install ansible
# Check ansible version
- ansible --version
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

View File

@@ -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).

View File

@@ -0,0 +1,7 @@
---
# defaults file for vmware-provision
vcenter_host: vcsa01.EXAMPLE-CORP.COM
template: RHEL9Template
cpus: 2
mem_mb: 4096
disk_gb: 60

View File

@@ -0,0 +1,2 @@
---
# handlers file for vmware_connected_network

View File

@@ -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.

Some files were not shown because too many files have changed in this diff Show More