Last active
September 26, 2018 18:48
-
-
Save JimmyJamTQBD/7fd1dd38952a86c762cffc8de21154c7 to your computer and use it in GitHub Desktop.
Ansible Demo Playbooks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
tasks: | |
- command: ansible-galaxy install cyberark.modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
roles: | |
- role: cyberark.modules | |
tasks: | |
- cyberark_credential: | |
api_base_url: "https://bizdevdemo.cyberark.skytapdns.com" | |
validate_certs: no | |
client_cert: "{{ CYBERARK_CLIENT_CERT }}" | |
client_key: "{{ CYBERARK_PRIV_KEY }}" | |
app_id: "sudo_pass" | |
query: "safe=Linux Root Accounts;folder=root;UserName=root;address={{ inventory_hostname }}" | |
reason: "Testing Ansible Playbook" | |
register: cyberark_response | |
delegate_to: localhost | |
- debug: msg="{{cyberark_response}}" | |
- name: set response to fact named cyberark_secret | |
set_fact: | |
cyberark_secret: "{{ cyberark_response.result.Content }}" | |
no_log: false | |
- hosts: all | |
connection: local | |
gather_facts: false | |
vars: | |
ansible_ssh_pass: "{{ cyberark_secret }}" | |
tasks: | |
- shell: echo Test | |
changed_when: false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment