Skip to content

Instantly share code, notes, and snippets.

@JimmyJamTQBD
Last active September 26, 2018 18:48
Show Gist options
  • Save JimmyJamTQBD/7fd1dd38952a86c762cffc8de21154c7 to your computer and use it in GitHub Desktop.
Save JimmyJamTQBD/7fd1dd38952a86c762cffc8de21154c7 to your computer and use it in GitHub Desktop.
Ansible Demo Playbooks
---
- hosts: localhost
tasks:
- command: ansible-galaxy install cyberark.modules
---
- 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