---
- name: Create a host in icinga
  telekom_mms.icinga_director.icinga_host:
    state: present
    url: "{{ icinga_url }}"
    url_username: "{{ icinga_user }}"
    url_password: "{{ icinga_pass }}"
    accept_config: true
    address: "127.0.0.1"
    address6: "::1"
    check_command: hostalive
    check_interval: 90s
    check_timeout: 60
    command_endpoint: fooendpoint
    disabled: false
    display_name: "foohost"
    enable_active_checks: true
    enable_event_handler: false
    enable_flapping: false
    enable_notifications: true
    enable_passive_checks: false
    enable_perfdata: false
    flapping_threshold_high: "30.0"
    flapping_threshold_low: "25.0"
    has_agent: true
    icon_image_alt: "alt text"
    icon_image: "http://url1"
    master_should_connect: true
    max_check_attempts: 3
    object_name: "foohost"
    retry_interval: "1m"
    volatile: false
    groups:
      - "foohostgroup"
    imports:
      - "foohosttemplate"
    vars:
      dnscheck: "no"
- name: update a host in icinga
  telekom_mms.icinga_director.icinga_host:
    state: present
    url: "{{ icinga_url }}"
    url_username: "{{ icinga_user }}"
    url_password: "{{ icinga_pass }}"
    object_name: "foohost"
    notes: "example note"
    notes_url: "'http://url1' 'http://url2'"
    append: true
