first commit
This commit is contained in:
38
roles/aruba_copy-primary-to-secondary/README.md
Normal file
38
roles/aruba_copy-primary-to-secondary/README.md
Normal 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).
|
||||
2
roles/aruba_copy-primary-to-secondary/defaults/main.yml
Normal file
2
roles/aruba_copy-primary-to-secondary/defaults/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# defaults file for aruba_copy-primary-to-secondary
|
||||
2
roles/aruba_copy-primary-to-secondary/handlers/main.yml
Normal file
2
roles/aruba_copy-primary-to-secondary/handlers/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for aruba_copy-primary-to-secondary
|
||||
55
roles/aruba_copy-primary-to-secondary/meta/main.yml
Normal file
55
roles/aruba_copy-primary-to-secondary/meta/main.yml
Normal file
@@ -0,0 +1,55 @@
|
||||
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.
|
||||
collections:
|
||||
- arubanetworks.aos_switch
|
||||
- ansible.netcommon
|
||||
2
roles/aruba_copy-primary-to-secondary/tasks/main.yml
Normal file
2
roles/aruba_copy-primary-to-secondary/tasks/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# tasks file for aruba_copy-primary-to-secondary
|
||||
2
roles/aruba_copy-primary-to-secondary/tests/inventory
Normal file
2
roles/aruba_copy-primary-to-secondary/tests/inventory
Normal file
@@ -0,0 +1,2 @@
|
||||
localhost
|
||||
|
||||
5
roles/aruba_copy-primary-to-secondary/tests/test.yml
Normal file
5
roles/aruba_copy-primary-to-secondary/tests/test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- aruba_copy-primary-to-secondary
|
||||
2
roles/aruba_copy-primary-to-secondary/vars/main.yml
Normal file
2
roles/aruba_copy-primary-to-secondary/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for aruba_copy-primary-to-secondary
|
||||
38
roles/aruba_get-boot-info/README.md
Normal file
38
roles/aruba_get-boot-info/README.md
Normal 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).
|
||||
2
roles/aruba_get-boot-info/defaults/main.yml
Normal file
2
roles/aruba_get-boot-info/defaults/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# defaults file for aruba_get-boot-info
|
||||
2
roles/aruba_get-boot-info/handlers/main.yml
Normal file
2
roles/aruba_get-boot-info/handlers/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for aruba_get-boot-info
|
||||
55
roles/aruba_get-boot-info/meta/main.yml
Normal file
55
roles/aruba_get-boot-info/meta/main.yml
Normal file
@@ -0,0 +1,55 @@
|
||||
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.
|
||||
collections:
|
||||
- arubanetworks.aos_switch
|
||||
- ansible.netcommon
|
||||
29
roles/aruba_get-boot-info/tasks/main.yml
Normal file
29
roles/aruba_get-boot-info/tasks/main.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
# tasks file for aruba_get-boot-info
|
||||
- name: Execute show flash on the switch
|
||||
arubaoss_command:
|
||||
commands: ['show flash']
|
||||
register: flash
|
||||
- name: set facts for boot images
|
||||
ansible.builtin.set_fact:
|
||||
primary: "{{ (flash.stdout_lines[0][2] | split(':'))[1] | trim }}"
|
||||
primary_version: "{{ (((((flash.stdout_lines[0][2] | split(':'))[1]) | split(' '))[6]) | split('.'))[1:] | join('.') }}"
|
||||
secondary: "{{ (flash.stdout_lines[0][3] | split(':'))[1] | trim }}"
|
||||
boot: "{{ (flash.stdout_lines[0][9] | split(':'))[1] | trim }}"
|
||||
type: "{{ (((((flash.stdout_lines[0][2] | split(':'))[1]) | split(' '))[6]) | split('.'))[0] }}"
|
||||
|
||||
- name: show primary boot image version
|
||||
debug:
|
||||
var: primary
|
||||
- name: show secondary boot image version
|
||||
debug:
|
||||
var: secondary
|
||||
- name: show default boot
|
||||
debug:
|
||||
var: boot
|
||||
- name: show type
|
||||
debug:
|
||||
var: type
|
||||
- name: show primary version
|
||||
debug:
|
||||
var: primary_version
|
||||
2
roles/aruba_get-boot-info/tests/inventory
Normal file
2
roles/aruba_get-boot-info/tests/inventory
Normal file
@@ -0,0 +1,2 @@
|
||||
localhost
|
||||
|
||||
5
roles/aruba_get-boot-info/tests/test.yml
Normal file
5
roles/aruba_get-boot-info/tests/test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- aruba_get-boot-info
|
||||
2
roles/aruba_get-boot-info/vars/main.yml
Normal file
2
roles/aruba_get-boot-info/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for aruba_get-boot-info
|
||||
38
roles/aruba_get-ntp-info/README.md
Normal file
38
roles/aruba_get-ntp-info/README.md
Normal 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).
|
||||
2
roles/aruba_get-ntp-info/defaults/main.yml
Normal file
2
roles/aruba_get-ntp-info/defaults/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# defaults file for aruba_get-ntp-info
|
||||
2
roles/aruba_get-ntp-info/handlers/main.yml
Normal file
2
roles/aruba_get-ntp-info/handlers/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for aruba_get-ntp-info
|
||||
55
roles/aruba_get-ntp-info/meta/main.yml
Normal file
55
roles/aruba_get-ntp-info/meta/main.yml
Normal file
@@ -0,0 +1,55 @@
|
||||
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.
|
||||
collections:
|
||||
- arubanetworks.aos_switch
|
||||
- ansible.netcommon
|
||||
13
roles/aruba_get-ntp-info/tasks/main.yml
Normal file
13
roles/aruba_get-ntp-info/tasks/main.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
# tasks file for aruba_get-boot-info
|
||||
- name: Execute show ntp on the switch
|
||||
arubaoss_command:
|
||||
commands: ['show ntp status']
|
||||
register: ntp
|
||||
- name: set facts for boot images
|
||||
ansible.builtin.set_fact:
|
||||
ntp_status: "{{ ((((ntp.stdout_lines[0][3]) | split(':'))[1]) | split(' '))[1] }}"
|
||||
|
||||
- name: show primary boot image version
|
||||
debug:
|
||||
var: ntp_status
|
||||
2
roles/aruba_get-ntp-info/tests/inventory
Normal file
2
roles/aruba_get-ntp-info/tests/inventory
Normal file
@@ -0,0 +1,2 @@
|
||||
localhost
|
||||
|
||||
5
roles/aruba_get-ntp-info/tests/test.yml
Normal file
5
roles/aruba_get-ntp-info/tests/test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- aruba_get-ntp-info
|
||||
2
roles/aruba_get-ntp-info/vars/main.yml
Normal file
2
roles/aruba_get-ntp-info/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for aruba_get-ntp-info
|
||||
38
roles/aruba_prepare-rest/README.md
Normal file
38
roles/aruba_prepare-rest/README.md
Normal 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).
|
||||
2
roles/aruba_prepare-rest/defaults/main.yml
Normal file
2
roles/aruba_prepare-rest/defaults/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# defaults file for aruba_prepare-rest
|
||||
2
roles/aruba_prepare-rest/handlers/main.yml
Normal file
2
roles/aruba_prepare-rest/handlers/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for aruba_prepare-rest
|
||||
55
roles/aruba_prepare-rest/meta/main.yml
Normal file
55
roles/aruba_prepare-rest/meta/main.yml
Normal file
@@ -0,0 +1,55 @@
|
||||
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.
|
||||
collections:
|
||||
- arubanetworks.aos_switch
|
||||
- ansible.netcommon
|
||||
16
roles/aruba_prepare-rest/tasks/main.yml
Normal file
16
roles/aruba_prepare-rest/tasks/main.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
# tasks file for aruba_prepare-rest
|
||||
|
||||
- name: Enable rest api
|
||||
arubaoss_command:
|
||||
commands: [ 'config',
|
||||
'crypto pki identity-profile sys-switchupgrade subject common-name sys-switchupgrade',
|
||||
'crypto pki enroll-self-signed certificate-name upgrade',
|
||||
'web-management ssl',
|
||||
'rest-interface',
|
||||
'aaa authentication rest login radius local',
|
||||
'aaa authentication rest enable radius local',
|
||||
'ip dns domain-name "adagility.net"',
|
||||
'ip dns server-address priority 1 10.245.142.82',
|
||||
'ip dns server-address priority 2 10.245.3.40']
|
||||
|
||||
2
roles/aruba_prepare-rest/tests/inventory
Normal file
2
roles/aruba_prepare-rest/tests/inventory
Normal file
@@ -0,0 +1,2 @@
|
||||
localhost
|
||||
|
||||
5
roles/aruba_prepare-rest/tests/test.yml
Normal file
5
roles/aruba_prepare-rest/tests/test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- aruba_prepare-rest
|
||||
2
roles/aruba_prepare-rest/vars/main.yml
Normal file
2
roles/aruba_prepare-rest/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for aruba_prepare-rest
|
||||
29
roles/awx_create-inventory-from-list/.travis.yml
Normal file
29
roles/awx_create-inventory-from-list/.travis.yml
Normal 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/
|
||||
38
roles/awx_create-inventory-from-list/README.md
Normal file
38
roles/awx_create-inventory-from-list/README.md
Normal 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).
|
||||
2
roles/awx_create-inventory-from-list/defaults/main.yml
Normal file
2
roles/awx_create-inventory-from-list/defaults/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# defaults file for awx_create-inventory-from-list
|
||||
2
roles/awx_create-inventory-from-list/handlers/main.yml
Normal file
2
roles/awx_create-inventory-from-list/handlers/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for awx_create-inventory-from-list
|
||||
52
roles/awx_create-inventory-from-list/meta/main.yml
Normal file
52
roles/awx_create-inventory-from-list/meta/main.yml
Normal 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.
|
||||
22
roles/awx_create-inventory-from-list/tasks/main.yml
Normal file
22
roles/awx_create-inventory-from-list/tasks/main.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
# tasks file for awx_create-inventory-from-list
|
||||
- name: Add inventory
|
||||
awx.awx.inventory:
|
||||
name: "Azure Arc enabled hosts (dynamic)"
|
||||
description: "Hosts synced from the azure arc prd resource group"
|
||||
organization: "Aperam"
|
||||
state: present
|
||||
controller_host: https://awx-prd.aperam.internal
|
||||
controller_oauthtoken: "{{oauth}}"
|
||||
validate_certs: false
|
||||
|
||||
- name: add hosts to inventory
|
||||
awx.awx.host:
|
||||
inventory: "Azure Arc enabled hosts (dynamic)"
|
||||
name: "{{item}}"
|
||||
state: present
|
||||
controller_host: https://awx-prd.aperam.internal
|
||||
controller_oauthtoken: "{{oauth}}"
|
||||
validate_certs: false
|
||||
enabled: true
|
||||
with_items: "{{namen}}"
|
||||
2
roles/awx_create-inventory-from-list/tests/inventory
Normal file
2
roles/awx_create-inventory-from-list/tests/inventory
Normal file
@@ -0,0 +1,2 @@
|
||||
localhost
|
||||
|
||||
5
roles/awx_create-inventory-from-list/tests/test.yml
Normal file
5
roles/awx_create-inventory-from-list/tests/test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- awx_create-inventory-from-list
|
||||
2
roles/awx_create-inventory-from-list/vars/main.yml
Normal file
2
roles/awx_create-inventory-from-list/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for awx_create-inventory-from-list
|
||||
38
roles/awx_import-hosts-from-list/README.md
Normal file
38
roles/awx_import-hosts-from-list/README.md
Normal 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).
|
||||
2
roles/awx_import-hosts-from-list/defaults/main.yml
Normal file
2
roles/awx_import-hosts-from-list/defaults/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# defaults file for awx_import-hosts-from-list
|
||||
2
roles/awx_import-hosts-from-list/handlers/main.yml
Normal file
2
roles/awx_import-hosts-from-list/handlers/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for awx_import-hosts-from-list
|
||||
34
roles/awx_import-hosts-from-list/meta/main.yml
Normal file
34
roles/awx_import-hosts-from-list/meta/main.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
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:
|
||||
|
||||
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.
|
||||
22
roles/awx_import-hosts-from-list/tasks/main.yml
Normal file
22
roles/awx_import-hosts-from-list/tasks/main.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
# tasks file for awx_import-hosts-from-list
|
||||
- name: create list
|
||||
set_fact:
|
||||
namen: []
|
||||
|
||||
- name: add hosts to list
|
||||
set_fact:
|
||||
namen: "{{ aruba_devices | split('\n') }}"
|
||||
|
||||
- name:
|
||||
debug:
|
||||
var: namen
|
||||
- name: make host group from survey hosts list
|
||||
add_host:
|
||||
hostname: "{{ item }}"
|
||||
groups: aruba_hosts
|
||||
ansible_user: sys-switchupgrade
|
||||
ansible_password: "{{aruba_pass}}"
|
||||
ansible_network_os: arubanetworks.aos_switch.arubaoss
|
||||
with_items: "{{namen}}"
|
||||
no_log: true
|
||||
2
roles/awx_import-hosts-from-list/tests/inventory
Normal file
2
roles/awx_import-hosts-from-list/tests/inventory
Normal file
@@ -0,0 +1,2 @@
|
||||
localhost
|
||||
|
||||
5
roles/awx_import-hosts-from-list/tests/test.yml
Normal file
5
roles/awx_import-hosts-from-list/tests/test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- awx_import-hosts-from-list
|
||||
2
roles/awx_import-hosts-from-list/vars/main.yml
Normal file
2
roles/awx_import-hosts-from-list/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for awx_import-hosts-from-list
|
||||
29
roles/azure_create-vnet/.travis.yml
Normal file
29
roles/azure_create-vnet/.travis.yml
Normal 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/
|
||||
38
roles/azure_create-vnet/README.md
Normal file
38
roles/azure_create-vnet/README.md
Normal 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).
|
||||
2
roles/azure_create-vnet/defaults/main.yml
Normal file
2
roles/azure_create-vnet/defaults/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# defaults file for azure_create-vnet
|
||||
2
roles/azure_create-vnet/handlers/main.yml
Normal file
2
roles/azure_create-vnet/handlers/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for azure_create-vnet
|
||||
52
roles/azure_create-vnet/meta/main.yml
Normal file
52
roles/azure_create-vnet/meta/main.yml
Normal 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.
|
||||
14
roles/azure_create-vnet/tasks/main.yml
Normal file
14
roles/azure_create-vnet/tasks/main.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
# tasks file for azure_create-vnet
|
||||
- name: Create virtual network
|
||||
azure_rm_virtualnetwork:
|
||||
resource_group: "{{RG_name}}"
|
||||
name: vNet
|
||||
address_prefixes: "10.0.0.0/16"
|
||||
|
||||
- name: Add subnet
|
||||
azure_rm_subnet:
|
||||
resource_group: "{{RG_name}}"
|
||||
name: subnet
|
||||
address_prefix: "10.0.1.0/24"
|
||||
virtual_network: vNet
|
||||
2
roles/azure_create-vnet/tests/inventory
Normal file
2
roles/azure_create-vnet/tests/inventory
Normal file
@@ -0,0 +1,2 @@
|
||||
localhost
|
||||
|
||||
5
roles/azure_create-vnet/tests/test.yml
Normal file
5
roles/azure_create-vnet/tests/test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- azure_create-vnet
|
||||
2
roles/azure_create-vnet/vars/main.yml
Normal file
2
roles/azure_create-vnet/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for azure_create-vnet
|
||||
29
roles/azure_createRG/.travis.yml
Normal file
29
roles/azure_createRG/.travis.yml
Normal 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/
|
||||
38
roles/azure_createRG/README.md
Normal file
38
roles/azure_createRG/README.md
Normal 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).
|
||||
8
roles/azure_createRG/defaults/main.yml
Normal file
8
roles/azure_createRG/defaults/main.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
# defaults file for azure-createRG
|
||||
tag_division: "Corporate"
|
||||
tag_scope: "Europe"
|
||||
tag_organizational: "ITInfrastructure"
|
||||
tag_environment: "TST"
|
||||
tag_businessapplicationowner: bram.vandendaele@aperam.com
|
||||
tag_applicationname: "demo"
|
||||
2
roles/azure_createRG/handlers/main.yml
Normal file
2
roles/azure_createRG/handlers/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for azure-createRG
|
||||
52
roles/azure_createRG/meta/main.yml
Normal file
52
roles/azure_createRG/meta/main.yml
Normal 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.
|
||||
13
roles/azure_createRG/tasks/main.yml
Normal file
13
roles/azure_createRG/tasks/main.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
# tasks file for azure-createRG
|
||||
- name: Create a resource group
|
||||
azure.azcollection.azure_rm_resourcegroup:
|
||||
name: "{{ RG_name }}"
|
||||
location: westeurope
|
||||
tags:
|
||||
Division: "{{ tag_division }}"
|
||||
Scope: "{{ tag_scope }}"
|
||||
Organizational: "{{ tag_organizational }}"
|
||||
ApplicationName: "{{ tag_applicationname }}"
|
||||
Environment: "{{ tag_environment }}"
|
||||
BusinessApplicationOwner: "{{ tag_businessapplicationowner }}"
|
||||
2
roles/azure_createRG/tests/inventory
Normal file
2
roles/azure_createRG/tests/inventory
Normal file
@@ -0,0 +1,2 @@
|
||||
localhost
|
||||
|
||||
5
roles/azure_createRG/tests/test.yml
Normal file
5
roles/azure_createRG/tests/test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- azure-createRG
|
||||
2
roles/azure_createRG/vars/main.yml
Normal file
2
roles/azure_createRG/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for azure-createRG
|
||||
29
roles/azure_createlinvm/.travis.yml
Normal file
29
roles/azure_createlinvm/.travis.yml
Normal 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/
|
||||
38
roles/azure_createlinvm/README.md
Normal file
38
roles/azure_createlinvm/README.md
Normal 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).
|
||||
3
roles/azure_createlinvm/defaults/main.yml
Normal file
3
roles/azure_createlinvm/defaults/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
# defaults file for azure-createwindowsvm
|
||||
vmsize: Standard_DS1_v2
|
||||
2
roles/azure_createlinvm/handlers/main.yml
Normal file
2
roles/azure_createlinvm/handlers/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for azure-createwindowsvm
|
||||
52
roles/azure_createlinvm/meta/main.yml
Normal file
52
roles/azure_createlinvm/meta/main.yml
Normal 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.
|
||||
79
roles/azure_createlinvm/tasks/main.yml
Normal file
79
roles/azure_createlinvm/tasks/main.yml
Normal file
@@ -0,0 +1,79 @@
|
||||
---
|
||||
# tasks file for azure-createwindowsvm
|
||||
# - name: Create public IP address
|
||||
# azure_rm_publicipaddress:
|
||||
# resource_group: "{{RG_name}}"
|
||||
# allocation_method: Static
|
||||
# name: "{{hostname}}-pip"
|
||||
# register: output_ip_address
|
||||
|
||||
# - name: Output public IP
|
||||
# debug:
|
||||
# msg: "The public IP is {{ output_ip_address.state.ip_address }}"
|
||||
|
||||
|
||||
- name: Get facts for one resource group
|
||||
azure_rm_resourcegroup_info:
|
||||
name: "{{RG_name}}"
|
||||
register: rginfo
|
||||
- name: Create a network interface
|
||||
azure_rm_networkinterface:
|
||||
name: "{{hostname}}-nic"
|
||||
resource_group: "{{RG_name}}"
|
||||
location: westeurope
|
||||
virtual_network: "/subscriptions/a7f4215b-c8f8-45ac-8fdd-062c940b02f6/resourceGroups/rg-network-glb-02/providers/Microsoft.Network/virtualNetworks/vnet-awe-glb-02"
|
||||
subnet_name: "{{subnetname}}"
|
||||
enable_accelerated_networking: True
|
||||
security_group: "/subscriptions/a7f4215b-c8f8-45ac-8fdd-062c940b02f6/resourceGroups/rg-network-glb-02/providers/Microsoft.Network/networkSecurityGroups/nsg-glb-02-green"
|
||||
ip_configurations:
|
||||
- name: default
|
||||
# public_ip_address_name: "{{hostname}}-pip"
|
||||
primary: True
|
||||
register: new_nic
|
||||
|
||||
- name: Get private IP of NIC
|
||||
azure_rm_networkinterface_info:
|
||||
resource_group: "{{RG_name}}"
|
||||
name: "{{hostname}}-nic"
|
||||
register: nic_info
|
||||
|
||||
- name: Display private IP of NIC
|
||||
debug:
|
||||
var: "nic_info.networkinterfaces[0].ip_configurations[0].private_ip_address"
|
||||
- name: Get facts by name
|
||||
azure_rm_virtualmachine_info:
|
||||
resource_group: "{{RG_name}}"
|
||||
name: "{{hostname}}"
|
||||
register: vmexist
|
||||
|
||||
- name: Create VM
|
||||
azure_rm_virtualmachine:
|
||||
resource_group: "{{RG_name}}"
|
||||
name: "{{hostname}}"
|
||||
vm_size: "{{vmsize}}"
|
||||
admin_username: ApeAdmin
|
||||
admin_password: "{{ password }}"
|
||||
network_interfaces: "{{hostname}}-nic"
|
||||
os_type: Linux
|
||||
boot_diagnostics:
|
||||
enabled: false
|
||||
managed_disk_type: "Premium_LRS"
|
||||
os_disk_name: "{{hostname}}-osdisk"
|
||||
os_disk_size_gb: 128
|
||||
image:
|
||||
offer: "{{lin_offer}}"
|
||||
publisher: Canonical
|
||||
sku: "{{lin_sku}}"
|
||||
version: latest
|
||||
tags:
|
||||
Dexcare: "{{tag_dexcare}}"
|
||||
ApplicationITContact: "{{tag_ApplicationITContact}}"
|
||||
DexMach_Protection: "ManagedByOther"
|
||||
Schedule: "{{tag_Schedule}}"
|
||||
ServiceHours: "{{tag_ServiceHours}}"
|
||||
Criticality: "{{tag_Criticality}}"
|
||||
UpdateSchedule: "{{tag_UpdateSchedule}}"
|
||||
TeamSpecialist: "{{tag_TeamSpecialist}}"
|
||||
no_log: false
|
||||
when: vmexist is failed
|
||||
|
||||
2
roles/azure_createlinvm/tests/inventory
Normal file
2
roles/azure_createlinvm/tests/inventory
Normal file
@@ -0,0 +1,2 @@
|
||||
localhost
|
||||
|
||||
5
roles/azure_createlinvm/tests/test.yml
Normal file
5
roles/azure_createlinvm/tests/test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- azure-createlinvm
|
||||
2
roles/azure_createlinvm/vars/main.yml
Normal file
2
roles/azure_createlinvm/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for azure-createwindowsvm
|
||||
29
roles/azure_createwindowsvm-demo/.travis.yml
Normal file
29
roles/azure_createwindowsvm-demo/.travis.yml
Normal 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/
|
||||
38
roles/azure_createwindowsvm-demo/README.md
Normal file
38
roles/azure_createwindowsvm-demo/README.md
Normal 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).
|
||||
3
roles/azure_createwindowsvm-demo/defaults/main.yml
Normal file
3
roles/azure_createwindowsvm-demo/defaults/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
# defaults file for azure-createwindowsvm
|
||||
vmsize: Standard_DS1_v2
|
||||
2
roles/azure_createwindowsvm-demo/handlers/main.yml
Normal file
2
roles/azure_createwindowsvm-demo/handlers/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for azure-createwindowsvm
|
||||
52
roles/azure_createwindowsvm-demo/meta/main.yml
Normal file
52
roles/azure_createwindowsvm-demo/meta/main.yml
Normal 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.
|
||||
123
roles/azure_createwindowsvm-demo/tasks/main.yml
Normal file
123
roles/azure_createwindowsvm-demo/tasks/main.yml
Normal file
@@ -0,0 +1,123 @@
|
||||
---
|
||||
# tasks file for azure-createwindowsvm
|
||||
# - name: Create public IP address
|
||||
# azure_rm_publicipaddress:
|
||||
# resource_group: "{{RG_name}}"
|
||||
# allocation_method: Static
|
||||
# name: "{{hostname}}-pip"
|
||||
# register: output_ip_address
|
||||
|
||||
# - name: Output public IP
|
||||
# debug:
|
||||
# msg: "The public IP is {{ output_ip_address.state.ip_address }}"
|
||||
|
||||
|
||||
- name: Get facts for one resource group
|
||||
azure_rm_resourcegroup_info:
|
||||
name: "{{RG_name}}"
|
||||
register: rginfo
|
||||
- name: Create a network interface
|
||||
azure_rm_networkinterface:
|
||||
name: "{{hostname}}-nic"
|
||||
resource_group: "{{RG_name}}"
|
||||
location: westeurope
|
||||
virtual_network: "/subscriptions/dd4dbc55-c970-4a1f-8ddd-8cb7ae7900dd/resourceGroups/rg-network-tst-01/providers/Microsoft.Network/virtualNetworks/vnet-awe-tst-01"
|
||||
subnet_name: "{{subnetname}}"
|
||||
enable_accelerated_networking: True
|
||||
security_group: "/subscriptions/dd4dbc55-c970-4a1f-8ddd-8cb7ae7900dd/resourceGroups/rg-network-tst-01/providers/Microsoft.Network/networkSecurityGroups/nsg-tst-01-green"
|
||||
ip_configurations:
|
||||
- name: default
|
||||
# public_ip_address_name: "{{hostname}}-pip"
|
||||
primary: True
|
||||
register: new_nic
|
||||
|
||||
- name: Get private IP of NIC
|
||||
azure_rm_networkinterface_info:
|
||||
resource_group: "{{RG_name}}"
|
||||
name: "{{hostname}}-nic"
|
||||
register: nic_info
|
||||
|
||||
- name: Display private IP of NIC
|
||||
debug:
|
||||
var: "nic_info.networkinterfaces[0].ip_configurations[0].private_ip_address"
|
||||
|
||||
- name: Create VM
|
||||
azure_rm_virtualmachine:
|
||||
resource_group: "{{RG_name}}"
|
||||
name: "{{hostname}}"
|
||||
vm_size: "{{vmsize}}"
|
||||
admin_username: ApeAdmin
|
||||
admin_password: "{{ password }}"
|
||||
network_interfaces: "{{hostname}}-nic"
|
||||
os_type: Windows
|
||||
boot_diagnostics:
|
||||
enabled: false
|
||||
managed_disk_type: "Premium_LRS"
|
||||
os_disk_name: "{{hostname}}-osdisk"
|
||||
os_disk_size_gb: 128
|
||||
image:
|
||||
offer: WindowsServer
|
||||
publisher: MicrosoftWindowsServer
|
||||
sku: "{{win_sku}}"
|
||||
version: latest
|
||||
tags:
|
||||
Dexcare: "{{tag_dexcare}}"
|
||||
ApplicationITContact: "{{tag_ApplicationITContact}}"
|
||||
DexMach_Protection: "ManagedByOther"
|
||||
Schedule: "{{tag_Schedule}}"
|
||||
ServiceHours: "{{tag_ServiceHours}}"
|
||||
Criticality: "{{tag_Criticality}}"
|
||||
UpdateSchedule: "{{tag_UpdateSchedule}}"
|
||||
TeamSpecialist: "{{tag_TeamSpecialist}}"
|
||||
no_log: false
|
||||
|
||||
# - name: Create VM script extension to enable HTTPS WinRM listener
|
||||
# azure_rm_virtualmachineextension:
|
||||
# name: winrm-extension
|
||||
# resource_group: "{{RG_name}}"
|
||||
# virtual_machine_name: "{{hostname}}"
|
||||
# publisher: Microsoft.Compute
|
||||
# virtual_machine_extension_type: CustomScriptExtension
|
||||
# type_handler_version: '1.9'
|
||||
# settings: '{"fileUris": ["https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1"],"commandToExecute": "powershell -ExecutionPolicy Unrestricted -File ConfigureRemotingForAnsible.ps1"}'
|
||||
# auto_upgrade_minor_version: true
|
||||
|
||||
- name: Enable winrm
|
||||
azure_rm_virtualmachineextension:
|
||||
name: winrm-extension
|
||||
resource_group: "{{RG_name}}"
|
||||
virtual_machine_name: "{{hostname}}"
|
||||
publisher: Microsoft.Compute
|
||||
virtual_machine_extension_type: CustomScriptExtension
|
||||
type_handler_version: '1.9'
|
||||
settings: '{"commandToExecute": "powershell winrm quickconfig -force"}'
|
||||
auto_upgrade_minor_version: true
|
||||
|
||||
- name: Open port
|
||||
azure_rm_virtualmachineextension:
|
||||
name: winrm-extension
|
||||
resource_group: "{{RG_name}}"
|
||||
virtual_machine_name: "{{hostname}}"
|
||||
publisher: Microsoft.Compute
|
||||
virtual_machine_extension_type: CustomScriptExtension
|
||||
type_handler_version: '1.9'
|
||||
settings: {"commandToExecute": "powershell New-NetFirewallRule -DisplayName 'Winrm' -Profile 'Public' -Direction Inbound -Action Allow -Protocol TCP -LocalPort 5985"}
|
||||
auto_upgrade_minor_version: true
|
||||
|
||||
|
||||
|
||||
# - name: Get facts for one Public IP
|
||||
# azure_rm_publicipaddress_info:
|
||||
# resource_group: "{{RG_name}}"
|
||||
# name: "{{hostname}}-pip"
|
||||
# register: publicipaddresses
|
||||
|
||||
# - name: set public ip address fact
|
||||
# set_fact: publicipaddress="{{ publicipaddresses | json_query('publicipaddresses[0].ip_address')}}"
|
||||
|
||||
- name: wait for the WinRM port to come online
|
||||
wait_for:
|
||||
port: 5985
|
||||
host: "{{nic_info.networkinterfaces[0].ip_configurations[0].private_ip_address}}"
|
||||
timeout: 6
|
||||
|
||||
2
roles/azure_createwindowsvm-demo/tests/inventory
Normal file
2
roles/azure_createwindowsvm-demo/tests/inventory
Normal file
@@ -0,0 +1,2 @@
|
||||
localhost
|
||||
|
||||
5
roles/azure_createwindowsvm-demo/tests/test.yml
Normal file
5
roles/azure_createwindowsvm-demo/tests/test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- azure-createwindowsvm
|
||||
2
roles/azure_createwindowsvm-demo/vars/main.yml
Normal file
2
roles/azure_createwindowsvm-demo/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for azure-createwindowsvm
|
||||
29
roles/azure_createwindowsvm/.travis.yml
Normal file
29
roles/azure_createwindowsvm/.travis.yml
Normal 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/
|
||||
38
roles/azure_createwindowsvm/README.md
Normal file
38
roles/azure_createwindowsvm/README.md
Normal 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).
|
||||
4
roles/azure_createwindowsvm/defaults/main.yml
Normal file
4
roles/azure_createwindowsvm/defaults/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
# defaults file for azure-createwindowsvm
|
||||
vmsize: Standard_DS1_v2
|
||||
location: westeurope
|
||||
2
roles/azure_createwindowsvm/handlers/main.yml
Normal file
2
roles/azure_createwindowsvm/handlers/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for azure-createwindowsvm
|
||||
52
roles/azure_createwindowsvm/meta/main.yml
Normal file
52
roles/azure_createwindowsvm/meta/main.yml
Normal 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.
|
||||
153
roles/azure_createwindowsvm/tasks/main.yml
Normal file
153
roles/azure_createwindowsvm/tasks/main.yml
Normal file
@@ -0,0 +1,153 @@
|
||||
---
|
||||
# This Ansible playbook is designed to create a Windows virtual machine (VM) in Azure and perform several setup tasks on it.
|
||||
# The tasks are executed on the localhost and are divided into several parts:
|
||||
#
|
||||
# 1. Get facts for one resource group: The playbook starts by gathering information about the Azure resource group where the VM will be created.
|
||||
# 2. Create a network interface: The playbook then creates a network interface for the VM. The network interface is associated with a specific virtual network and subnet.
|
||||
# 3. Get private IP of NIC: The playbook retrieves the private IP address of the newly created network interface.
|
||||
# 4. Create VM: The playbook creates the VM. The VM is associated with the previously created network interface. The VM is configured with a specific size, admin username and password, OS type, managed disk type, and image. The VM is also tagged with several key-value pairs.
|
||||
# 5. Enable WinRM and Open Port 5985: The playbook enables Windows Remote Management (WinRM) on the VM and opens port 5985. This is done using a VM extension that runs a PowerShell command.
|
||||
# 6. Wait for WinRM HTTP Port to Come Online: The playbook waits for the WinRM HTTP port (5985) to come online. This is done using the wait_for module.
|
||||
# 7. Get VM Facts: The playbook retrieves information about the newly created VM.
|
||||
# 8. Set the Correct Recovery Service Vault: The playbook sets the recovery service vault for the VM. The recovery service vault is set to 'backupvault-awe-01' if the accdevtest variable is set to 'PRD', and 'backupvault-awe-03' otherwise.
|
||||
#
|
||||
# In all tasks, the resource_group parameter is set to the RG_name variable, and the name parameter is set to the hostname variable. The playbook uses the azure_rm modules to interact with Azure.
|
||||
|
||||
# tasks file for azure-createwindowsvm
|
||||
- name: Get facts for one resource group
|
||||
azure_rm_resourcegroup_info:
|
||||
name: "{{RG_name}}"
|
||||
register: rginfo
|
||||
- name: Create a network interface
|
||||
azure_rm_networkinterface:
|
||||
name: "{{hostname}}-nic"
|
||||
resource_group: "{{RG_name}}"
|
||||
location: "{{location}}"
|
||||
# virtual_network: "/subscriptions/a7f4215b-c8f8-45ac-8fdd-062c940b02f6/resourceGroups/rg-network-glb-02/providers/Microsoft.Network/virtualNetworks/vnet-awe-glb-02"
|
||||
virtual_network: "{{ vnetid }}"
|
||||
subnet_name: "{{subnetname}}"
|
||||
enable_accelerated_networking: True
|
||||
create_with_security_group: false
|
||||
#security_group: "/subscriptions/a7f4215b-c8f8-45ac-8fdd-062c940b02f6/resourceGroups/rg-network-glb-02/providers/Microsoft.Network/networkSecurityGroups/nsg-glb-02-green"
|
||||
ip_configurations:
|
||||
- name: default
|
||||
# public_ip_address_name: "{{hostname}}-pip"
|
||||
primary: True
|
||||
register: new_nic
|
||||
|
||||
- name: Get private IP of NIC
|
||||
azure_rm_networkinterface_info:
|
||||
resource_group: "{{RG_name}}"
|
||||
name: "{{hostname}}-nic"
|
||||
register: nic_info
|
||||
|
||||
- name: Display private IP of NIC
|
||||
debug:
|
||||
var: "nic_info.networkinterfaces[0].ip_configurations[0].private_ip_address"
|
||||
|
||||
- name: Create VM
|
||||
azure_rm_virtualmachine:
|
||||
resource_group: "{{RG_name}}"
|
||||
name: "{{hostname}}"
|
||||
vm_size: "{{vmsize}}"
|
||||
admin_username: ApeAdmin
|
||||
admin_password: "{{ password }}"
|
||||
network_interfaces: "{{hostname}}-nic"
|
||||
os_type: Windows
|
||||
boot_diagnostics:
|
||||
enabled: false
|
||||
managed_disk_type: "Premium_LRS"
|
||||
os_disk_name: "{{hostname}}-osdisk"
|
||||
os_disk_size_gb: 128
|
||||
os_disk_caching: "ReadWrite"
|
||||
image:
|
||||
offer: "{{ vm_offer }}"
|
||||
publisher: "{{ vm_publisher }}"
|
||||
sku: "{{win_sku}}"
|
||||
version: latest
|
||||
license_type: Windows_Server
|
||||
tags:
|
||||
Dexcare: "{{tag_dexcare}}"
|
||||
ApplicationITContact: "{{tag_ApplicationITContact}}"
|
||||
DexMach_IaaSOperations: "NoMDEAgent,NoProtection"
|
||||
Schedule: "{{tag_Schedule}}"
|
||||
ServiceHours: "{{tag_ServiceHours}}"
|
||||
Criticality: "{{tag_Criticality}}"
|
||||
UpdateSchedule: "{{tag_UpdateSchedule}}"
|
||||
TeamSpecialist: "{{tag_TeamSpecialist}}"
|
||||
NotificationTeam: "{{tag_NotificationTeam}}"
|
||||
no_log: true
|
||||
|
||||
# - name: Create VM script extension to enable HTTPS WinRM listener
|
||||
# azure_rm_virtualmachineextension:
|
||||
# name: winrm-extension
|
||||
# resource_group: "{{RG_name}}"
|
||||
# virtual_machine_name: "{{hostname}}"
|
||||
# publisher: Microsoft.Compute
|
||||
# virtual_machine_extension_type: CustomScriptExtension
|
||||
# type_handler_version: '1.9'
|
||||
# settings: '{"fileUris": ["https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1"],"commandToExecute": "powershell -ExecutionPolicy Unrestricted -File ConfigureRemotingForAnsible.ps1"}'
|
||||
# auto_upgrade_minor_version: true
|
||||
|
||||
# - name: Get facts for one Public IP
|
||||
# azure_rm_publicipaddress_info:
|
||||
# resource_group: "{{RG_name}}"
|
||||
# name: "{{hostname}}-pip"
|
||||
# register: publicipaddresses
|
||||
|
||||
# - name: set public ip address fact
|
||||
# set_fact: publicipaddress="{{ publicipaddresses | json_query('publicipaddresses[0].ip_address')}}"
|
||||
|
||||
# - name: wait for the WinRM HTTP port to come online
|
||||
# wait_for:
|
||||
# port: 5985
|
||||
# host: "{{nic_info.networkinterfaces[0].ip_configurations[0].private_ip_address}}"
|
||||
# timeout: 60
|
||||
# ignore_errors: true
|
||||
|
||||
- name: Enable winrm + open port 5985
|
||||
azure_rm_virtualmachineextension:
|
||||
name: winrm-extension
|
||||
resource_group: "{{RG_name}}"
|
||||
virtual_machine_name: "{{hostname}}"
|
||||
publisher: Microsoft.Compute
|
||||
virtual_machine_extension_type: CustomScriptExtension
|
||||
type_handler_version: '1.9'
|
||||
settings: {"commandToExecute": "powershell winrm quickconfig -force; New-NetFirewallRule -DisplayName 'Winrm' -Profile 'Public' -Direction Inbound -Action Allow -Protocol TCP -LocalPort 5985"}
|
||||
auto_upgrade_minor_version: true
|
||||
|
||||
- name: wait for the WinRM HTTP port to come online
|
||||
wait_for:
|
||||
port: 5985
|
||||
host: "{{nic_info.networkinterfaces[0].ip_configurations[0].private_ip_address}}"
|
||||
timeout: 60
|
||||
ignore_errors: true
|
||||
|
||||
|
||||
- name: get vm facts
|
||||
azure_rm_virtualmachine_info:
|
||||
resource_group: "{{RG_name}}"
|
||||
name: "{{hostname}}"
|
||||
register: vminfo
|
||||
- name: Display vm id
|
||||
debug:
|
||||
var: "vminfo.vms[0].id"
|
||||
- name: set the correct recovery service vault
|
||||
azure.azcollection.azure_rm_backupazurevm:
|
||||
resource_group: "{{vaultRg}}"
|
||||
recovery_vault_name: "{{vaultName}}"
|
||||
resource_id: "{{vminfo.vms[0].id}}"
|
||||
backup_policy_id: "{{vaultId}}"
|
||||
|
||||
#when: accdevtest == 'PRD'
|
||||
ignore_errors: true
|
||||
|
||||
# - name: set the correct recovery service vault if not PRD
|
||||
# azure.azcollection.azure_rm_backupazurevm:
|
||||
# resource_group: 'rg-management-awe'
|
||||
# recovery_vault_name: 'backupvault-awe-03'
|
||||
# resource_id: "{{vminfo.vms[0].id}}"
|
||||
# backup_policy_id: '/subscriptions/a7f4215b-c8f8-45ac-8fdd-062c940b02f6/resourceGroups/rg-management-awe/providers/Microsoft.RecoveryServices/vaults/backupvault-awe-03/backupPolicies/Daily-Ret3M-Schedule'
|
||||
# when: accdevtest != 'PRD'
|
||||
# ignore_errors: true
|
||||
|
||||
2
roles/azure_createwindowsvm/tests/inventory
Normal file
2
roles/azure_createwindowsvm/tests/inventory
Normal file
@@ -0,0 +1,2 @@
|
||||
localhost
|
||||
|
||||
5
roles/azure_createwindowsvm/tests/test.yml
Normal file
5
roles/azure_createwindowsvm/tests/test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- azure-createwindowsvm
|
||||
2
roles/azure_createwindowsvm/vars/main.yml
Normal file
2
roles/azure_createwindowsvm/vars/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for azure-createwindowsvm
|
||||
29
roles/azure_delete-rg/.travis.yml
Normal file
29
roles/azure_delete-rg/.travis.yml
Normal 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/
|
||||
38
roles/azure_delete-rg/README.md
Normal file
38
roles/azure_delete-rg/README.md
Normal 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).
|
||||
2
roles/azure_delete-rg/defaults/main.yml
Normal file
2
roles/azure_delete-rg/defaults/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# defaults file for azure_delete-rg
|
||||
2
roles/azure_delete-rg/handlers/main.yml
Normal file
2
roles/azure_delete-rg/handlers/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
# handlers file for azure_delete-rg
|
||||
52
roles/azure_delete-rg/meta/main.yml
Normal file
52
roles/azure_delete-rg/meta/main.yml
Normal 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.
|
||||
7
roles/azure_delete-rg/tasks/main.yml
Normal file
7
roles/azure_delete-rg/tasks/main.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
# tasks file for azure_delete-rg
|
||||
- name: Delete a resource group including resources it contains
|
||||
azure_rm_resourcegroup:
|
||||
name: "{{RG_name}}"
|
||||
force_delete_nonempty: yes
|
||||
state: absent
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user