Commit cd61cbbf authored by matt's avatar matt
Browse files

tidy up and debug info

parent 29b16ab7
---
# Client settings (self: satellite, agent)
icinga_client_fqdn: "{{ ansible_fqdn }}"
icinga_client_ip: "{{ ansible_default_ipv4.address }}"
icinga_client_certs_path: /var/lib/icinga2/certs/
icinga_client_win_certs_path: 'C:\ProgramData\icinga2\etc\icinga2\pki\'
# How to get the ticket from the master; choice (ansible, director)
icinga_client_generate_ticket: "ansible"
# Parent setting (upstream: master, satellite)
icinga_parent_port: 5665
icinga_parent_endpoint: "{{ icinga_parent_fqdn ~ ',' ~ icinga_parent_ip ~ ',' ~ icinga_parent_port }}"
# Director settings
icinga_director_user: admin
icinga_director_host_protocol: http
icinga_director_url: "{{ icinga_director_host_protocol ~ '://' ~ icinga_master_fqdn ~ '/icingaweb2/director' }}"
- name: Get Icinga client ticket using ansible (icinga master)
command: sudo -u nagios /usr/sbin/icinga2 pki ticket --cn {{ icinga_client_fqdn }} # Added nagios line to /etc/sudoers on above host, after #include line
delegate_to: "{{ icinga_master_fqdn }}"
become: false
register: icinga_client_ticket
- name: Icinga ticket from stdout
set_fact:
icinga_client_ticket: "{{ icinga_client_ticket.stdout }}"
when:
- icinga_client_ticket.stdout
\ No newline at end of file
---
- name: Run Windows install
import_tasks: satellite-windows.yml
when: ansible_connection == 'winrm'
- name: Setup details
debug:
msg: "{{ item }}"
loop:
- "icinga_client_fqdn: {{ icinga_client_fqdn | default('Not set')}} "
- "icinga_client_ip: {{ icinga_client_ip | default('Not set')}} "
- "icinga_client_certs_path: {{ icinga_client_certs_path | default('Not set')}} "
- "icinga_client_win_certs_path: {{ icinga_client_win_certs_path | default('Not set')}} "
- "icinga_parent_port: {{ icinga_parent_port | default('Not set')}} "
- "icinga_parent_ip: {{ icinga_parent_ip | default('Not set')}} "
- "icinga_parent_fqdn: {{ icinga_parent_fqdn | default('Not set')}} "
- "icinga_parent_endpoint: {{ icinga_parent_endpoint | default('Not set')}} "
- "icinga_master_fqdn: {{ icinga_master_fqdn | default('Not set')}} "
- "icinga_director_user: {{ icinga_director_user | default('Not set')}} "
- "icinga_director_url: {{ icinga_director_url | default('Not set')}} "
- name: Run Linux install
import_tasks: satellite-linux.yml
when: ansible_connection != 'winrm'
- name: Run Windows install
import_tasks: satellite-windows.yml
when: ansible_connection == 'winrm'
- name: Run Linux install
import_tasks: satellite-linux.yml
when: ansible_connection != 'winrm'
......@@ -33,20 +33,10 @@
when:
- icinga_client_generate_ticket == "director"
- name: Get Icinga client ticket using ansible (icinga master)
command: sudo -u nagios /usr/sbin/icinga2 pki ticket --cn {{ icinga_client_fqdn }} # Added nagios line to /etc/sudoers on above host, after #include line
delegate_to: "{{ icinga_master_fqdn }}"
become: false
register: icinga_client_ticket
- name: Get ticket
import_tasks: common-ticket-ansible.yml
when: icinga_client_generate_ticket == "ansible"
- name: Icinga ticket from stdout
set_fact:
icinga_client_ticket: "{{ icinga_client_ticket.stdout }}"
when:
- icinga_client_generate_ticket == "ansible"
- icinga_client_ticket.stdout
- name: Icinga ticket
debug:
msg: "ticket: {{ icinga_client_ticket }}"
......
......@@ -31,20 +31,10 @@
when:
- icinga_client_generate_ticket == "director"
- name: Get Icinga client ticket using ansible (icinga master)
command: sudo -u nagios /usr/sbin/icinga2 pki ticket --cn {{ icinga_client_fqdn }} # Added nagios line to /etc/sudoers on above host, after #include line
delegate_to: "{{ icinga_master_fqdn }}"
become: false
register: icinga_client_ticket
- name: Get ticket
import_tasks: common-ticket-ansible.yml
when: icinga_client_generate_ticket == "ansible"
- name: Icinga ticket from stdout
set_fact:
icinga_client_ticket: "{{ icinga_client_ticket.stdout }}"
when:
- icinga_client_generate_ticket == "ansible"
- icinga_client_ticket.stdout
- name: Icinga ticket
debug:
msg: "ticket: {{ icinga_client_ticket }}"
......
Markdown is supported
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