Commit b132a2a2 authored by Matthew Smith's avatar Matthew Smith
Browse files

tidy up and fixes

parent 64f00840
......@@ -32,9 +32,10 @@ This role requires Ansible 2.4 or higher. Requirements are listed in the metadat
| `icinga_master_cn` | No | Not set | Icinga master Endpoint name. |
| `icinga_master_address` | No | `{{ icinga_master_cn }}` | Icinga master IP or FQDN. |
| `icinga_master_port` | No | `5665` | Icinga master port. |
| `icinga_api_url` | No | `{{ icinga_director_host_protocol ~ '://' ~ icinga_master_address ~ ':' ~ icinga_master_port ~ '/v1' }}` | url to communicate with Icinga API. |
| `icinga_api_user` | No | Not set | Icinga API user for API authentication. |
| `icinga_api_pass` | No | Not set | Icinga API user password for API authentication. |
| `icinga_api_protocol` | No | `https` | Icinga API user protocol for the API url. |
| `icinga_api_url` | No | `{{ icinga_api_protocol ~ '://' ~ icinga_master_address ~ ':' ~ icinga_master_port ~ '/v1' }}` | url to communicate with Icinga API. |
| **Director Vars** (Director API) |
| `icinga_director_user` | No | Not set | Icinga Web user for director authentication. |
| `icinga_director_pass` | No | Not set | Icinga Web user password for director authentication. |
......
......@@ -23,7 +23,10 @@ icinga_parent_endpoint_string: "{{ icinga_parent_endpoint ~ ',' ~ icinga_parent_
icinga_master_cn: "{{ icinga_master_fqdn | default() }}"
icinga_master_port: 5665
icinga_master_address: "{{ icinga_master_ip | default(icinga_master_cn) }}"
icinga_master_api_url: "{{ icinga_director_host_protocol ~ '://' ~ icinga_master_address ~ ':' ~ icinga_master_port ~ '/v1' }}"
# Icinga API settings
icinga_api_protocol: https
icinga_api_url: "{{ icinga_api_protocol ~ '://' ~ icinga_master_address ~ ':' ~ icinga_master_port ~ '/v1' }}"
# Director settings
icinga_director_host_protocol: http
......
......@@ -5,9 +5,11 @@
apt:
name: jq
state: latest
when:
- ansible_connection != 'winrm'
- name: Get Icinga client ticket using icinga api via curl (linux)
shell: "curl -k -X POST https://articingahead01.fsa.ninja:5665/v1/actions/generate-ticket -d {'{{ icinga_ticket_json }}'} --noproxy '*' -H 'Accept: application/json' -H 'Content-Type: application/json' -u {{ icinga_api_user }}:{{ icinga_api_pass }}|jq -r '.results[] |.ticket'"
shell: "curl -k -X POST {{ icinga_api_url }}/actions/generate-ticket -d {'{{ icinga_ticket_json }}'} --noproxy '*' -H 'Accept: application/json' -H 'Content-Type: application/json' -u {{ icinga_api_user }}:{{ icinga_api_pass }}|jq -r '.results[] |.ticket'"
register: icinga_api_ticket
when:
- ansible_connection != 'winrm'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment