@@ -38,5 +38,4 @@ Please push contributions via a pull request following the naming convention of
|
|||||||
- Name: Controller Credential
|
- Name: Controller Credential
|
||||||
- Extra vars:
|
- Extra vars:
|
||||||
|
|
||||||
demo: linux
|
demo: <linux or windows>
|
||||||
|
|
||||||
|
|||||||
@@ -7,4 +7,6 @@ collections:
|
|||||||
- redhat.insights
|
- redhat.insights
|
||||||
- redhat.rhel_system_roles
|
- redhat.rhel_system_roles
|
||||||
- community.general
|
- community.general
|
||||||
- containers.podman
|
- containers.podman
|
||||||
|
#windows
|
||||||
|
- chocolatey.chocolatey
|
||||||
|
|||||||
25
windows/install_iis.yml
Normal file
25
windows/install_iis.yml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
- name: Install IIS
|
||||||
|
hosts: "{{ HOSTS | default('windows') }}"
|
||||||
|
vars:
|
||||||
|
iis_message: undef
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Install IIS
|
||||||
|
win_feature:
|
||||||
|
name: Web-Server
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Start IIS service
|
||||||
|
win_service:
|
||||||
|
name: W3Svc
|
||||||
|
state: started
|
||||||
|
|
||||||
|
- name: Create website index.html
|
||||||
|
win_copy:
|
||||||
|
content: "{{ iis_message }}"
|
||||||
|
dest: C:\Inetpub\wwwroot\index.html
|
||||||
|
|
||||||
|
- name: Show website address
|
||||||
|
debug:
|
||||||
|
msg: http://{{ ansible_host }}
|
||||||
116
windows/setup.yml
Normal file
116
windows/setup.yml
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
---
|
||||||
|
controller_components:
|
||||||
|
- projects
|
||||||
|
- job_templates
|
||||||
|
|
||||||
|
controller_projects:
|
||||||
|
- name: Fact Scan
|
||||||
|
organization: Default
|
||||||
|
scm_type: git
|
||||||
|
scm_url: 'https://github.com/ansible/awx-facts-playbooks.git'
|
||||||
|
|
||||||
|
controller_templates:
|
||||||
|
- name: "WINDOWS / Install IIS"
|
||||||
|
job_type: run
|
||||||
|
inventory: "Workshop Inventory"
|
||||||
|
project: "Ansible official demo project"
|
||||||
|
playbook: "windows/install_iis.yml"
|
||||||
|
execution_environment: Default execution environment
|
||||||
|
credentials:
|
||||||
|
- "Workshop Credential"
|
||||||
|
survey_enabled: true
|
||||||
|
survey:
|
||||||
|
name: ''
|
||||||
|
description: ''
|
||||||
|
spec:
|
||||||
|
- question_name: Server Name or Pattern
|
||||||
|
type: text
|
||||||
|
variable: HOSTS
|
||||||
|
required: false
|
||||||
|
- question_name: web content
|
||||||
|
type: text
|
||||||
|
variable: iis_message
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- name: "WINDOWS / Windows updates"
|
||||||
|
job_type: run
|
||||||
|
inventory: "Workshop Inventory"
|
||||||
|
project: "Ansible official demo project"
|
||||||
|
playbook: "windows/windows_updates.yml"
|
||||||
|
execution_environment: Default execution environment
|
||||||
|
credentials:
|
||||||
|
- "Workshop Credential"
|
||||||
|
survey_enabled: true
|
||||||
|
survey:
|
||||||
|
name: ''
|
||||||
|
description: ''
|
||||||
|
spec:
|
||||||
|
- question_name: Server Name or Pattern
|
||||||
|
type: text
|
||||||
|
variable: HOSTS
|
||||||
|
required: false
|
||||||
|
- question_name: Update categories
|
||||||
|
type: multiplechoice
|
||||||
|
variable: categories
|
||||||
|
required: false
|
||||||
|
default: SecurityUpdates
|
||||||
|
choices:
|
||||||
|
- Application
|
||||||
|
- Connectors
|
||||||
|
- CriticalUpdates
|
||||||
|
- DefinitionUpdates
|
||||||
|
- DeveloperKits
|
||||||
|
- FeaturePacks Guidance
|
||||||
|
- SecurityUpdates
|
||||||
|
- ServicePacks
|
||||||
|
- Tools
|
||||||
|
- UpdateRollups
|
||||||
|
- Updates
|
||||||
|
- question_name: Reboot after install?
|
||||||
|
type: multiplechoice
|
||||||
|
variable: reboot_server
|
||||||
|
required: false
|
||||||
|
default: 'Yes'
|
||||||
|
choices:
|
||||||
|
- 'Yes'
|
||||||
|
- 'No'
|
||||||
|
|
||||||
|
- name: "WINDOWS / Chocolatey install multiple"
|
||||||
|
job_type: run
|
||||||
|
inventory: "Workshop Inventory"
|
||||||
|
project: "Ansible official demo project"
|
||||||
|
playbook: "windows/windows_choco_multiple.yml"
|
||||||
|
execution_environment: Default execution environment
|
||||||
|
credentials:
|
||||||
|
- "Workshop Credential"
|
||||||
|
survey_enabled: true
|
||||||
|
survey:
|
||||||
|
name: ''
|
||||||
|
description: ''
|
||||||
|
spec:
|
||||||
|
- question_name: Server Name or Pattern
|
||||||
|
type: text
|
||||||
|
variable: HOSTS
|
||||||
|
required: false
|
||||||
|
|
||||||
|
- name: "WINDOWS / Chocolatey install specific"
|
||||||
|
job_type: run
|
||||||
|
inventory: "Workshop Inventory"
|
||||||
|
project: "Ansible official demo project"
|
||||||
|
playbook: "windows/windows_choco_specific.yml"
|
||||||
|
execution_environment: Default execution environment
|
||||||
|
credentials:
|
||||||
|
- "Workshop Credential"
|
||||||
|
survey_enabled: true
|
||||||
|
survey:
|
||||||
|
name: ''
|
||||||
|
description: ''
|
||||||
|
spec:
|
||||||
|
- question_name: Server Name or Pattern
|
||||||
|
type: text
|
||||||
|
variable: HOSTS
|
||||||
|
required: false
|
||||||
|
- question_name: Package name
|
||||||
|
type: text
|
||||||
|
variable: package_name
|
||||||
|
required: true
|
||||||
29
windows/windows_choco_multiple.yml
Normal file
29
windows/windows_choco_multiple.yml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
- name: Chocolatey install multiple
|
||||||
|
hosts: "{{ HOSTS | default('windows') }}"
|
||||||
|
gather_facts: false
|
||||||
|
vars:
|
||||||
|
choco_packages:
|
||||||
|
- name: nodejs
|
||||||
|
version: 13.0.0
|
||||||
|
- name: python
|
||||||
|
version: 3.6.0
|
||||||
|
tasks:
|
||||||
|
- name: Install specific versions of packages sequentially
|
||||||
|
win_chocolatey:
|
||||||
|
name: "{{ item.name }}"
|
||||||
|
version: "{{ item.version }}"
|
||||||
|
loop: "{{ choco_packages }}"
|
||||||
|
|
||||||
|
- name: Check python version
|
||||||
|
win_command: python --version
|
||||||
|
register: check_python_version
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- name: Check nodejs version
|
||||||
|
win_command: node --version
|
||||||
|
register: check_node_version
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- debug:
|
||||||
|
msg: Python Version is {{ check_python_version.stdout_lines[0] }} and NodeJS version is {{ check_node_version.stdout_lines[0] }}
|
||||||
9
windows/windows_choco_specific.yml
Normal file
9
windows/windows_choco_specific.yml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
- name: Chocolatey install specific
|
||||||
|
hosts: "{{ HOSTS | default('windows') }}"
|
||||||
|
gather_facts: false
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Install choco package with specific version
|
||||||
|
win_chocolatey:
|
||||||
|
name: "{{ package_name }}"
|
||||||
9
windows/windows_updates.yml
Normal file
9
windows/windows_updates.yml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
- name: Windows updates
|
||||||
|
hosts: "{{ HOSTS | default('windows') }}"
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Install Windows Updates
|
||||||
|
win_updates:
|
||||||
|
category_names: "{{ categories | default(omit) }}"
|
||||||
|
reboot: '{{ reboot_server | default(yes) }}'
|
||||||
Reference in New Issue
Block a user