added option to configure Azure Cloud demos

This commit is contained in:
David Rojas
2020-09-26 13:10:33 -07:00
parent 683770889a
commit 4dcf2ee423
5 changed files with 53 additions and 0 deletions

View File

@@ -13,3 +13,11 @@ my_tower_username: student1
my_tower_password: 6nk4if5SHProkr
my_tower_host: student1.a7d7.open.redhat.com
workshop_type: windows
#only uncomment these for setting up an Azure Cloud Demo
azure_demo: True
my_subscription:
my_tenant:
my_client:
my_secret:

View File

@@ -37,6 +37,23 @@ Coming Soon
# Guide
0. Create Service Principal:
Azure Active Directory
App Registration
new registartion
enter name and defautl all else click register
get client Id and tenatn id Alrady have sub ID
go to subscriptions
select Access Cntrol
add role with contributor adn select new app reg
go back to active dir
app reg
cert and secrets
new clietn secret
get clietn secret value only chance
now build cred in Tower
add cred to job temp
1. Login to Ansible Platform UX
2. Navigate to **Templates**

View File

@@ -0,0 +1,22 @@
---
- name: add azure credential
tower_credential:
name: azure credential
description: Azure Service Principle
organization: "{{ vars[demo].project.organization }}"
state: present
kind: azure_rm
subscription: "{{ my_subcription }}"
tenant: "{{ my_tenant }}"
client: "{{ my_client }}"
secret: "{{ my_secret }}"
tower_username: "{{ my_tower_username }}"
tower_password: "{{ my_tower_password }}"
tower_host: "{{ my_tower_host }}"
- name: setting the new azure cred to cloud cred var
my_cloud_cred: azure credential

View File

@@ -43,6 +43,7 @@
playbook: "{{ vars[demo].playbook }}"
fact_caching_enabled: "{{ vars[demo].fact_caching_enabled | default('false') }}"
credential: "{{ vars[demo].credential }}"
cloud_credential: "{{ my_cloud_cred | default(omit) }}"
survey_enabled: "{{ vars[demo].survey_enabled }}"
survey_spec: "{{ vars[demo].survey_spec }}"
tower_username: "{{ my_tower_username }}"

View File

@@ -20,6 +20,11 @@
- "demo must be defined and be one of: {{ demo_list }}"
- "full list can be found on https://github.com/ansible/product-demos"
- name: install Azure cred
include_tasks: azure_cred.yml
when:
- azure_demo == True
- name: install all job templates
include_tasks: job_template_loop.yml
loop: "{{ full_demo_info }}"