forked from redhat-partner-tech/automated-smart-management
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_tower_creds.yml
29 lines (27 loc) · 1.11 KB
/
setup_tower_creds.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
---
- hosts: "{{ HOSTS | default('control[0]') }}"
connection: local
tasks:
#### REMOVE STANDARD DEMO CREDENTIAL
- name: remove standard demo SSH credential from Ansible Tower
awx.awx.tower_credential:
username: ec2-user
name: "Workshop Credential"
ssh_key_data: "{{ lookup('file', playbook_dir +'/' + ec2_name_prefix + '/' + ec2_name_prefix + '-private.pem') }}"
kind: ssh
state: absent
#### END OF REMOVE STANDARD DEMO CONTENT
#### CREDENTIAL
- name: add RHEL node SSH credential into Ansible Tower
awx.awx.tower_credential:
username: ec2-user
name: "RHEL SSH Credential"
ssh_key_data: "{{ lookup('file', playbook_dir +'/' + ec2_name_prefix + '/' + ec2_name_prefix + '-private.pem') }}"
kind: ssh
- name: add CentOS node SSH credential into Ansible Tower
awx.awx.tower_credential:
username: centos
name: "CentOS SSH Credential"
ssh_key_data: "{{ lookup('file', playbook_dir +'/' + ec2_name_prefix + '/' + ec2_name_prefix + '-private.pem') }}"
kind: ssh
#### END OF CREDENTIAL