Skip to content
Snippets Groups Projects
Select Git revision
  • 7cf8ad4dc732f5f09ee59a6b1d9b8c620a972b9d
  • master default protected
  • v2.28.0
  • v2.27.0
  • v2.25.1
  • v2.24.3
  • v2.26.0
  • v2.24.2
  • v2.25.0
  • v2.24.1
  • v2.22.2
  • v2.23.3
  • v2.24.0
  • v2.23.2
  • v2.23.1
  • v2.23.0
  • v2.22.1
  • v2.22.0
  • v2.21.0
  • v2.20.0
  • v2.19.1
  • v2.18.2
22 results

kube-ovn.md

Blame
  • test_host.yml 7.07 KiB
    ---
    - name: Test host
      hosts: "{{ ipa_test_host | default('ipaserver') }}"
      become: true
    
      tasks:
      - name: Get Domain from server name
        set_fact:
          ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
        when: ipaserver_domain is not defined
    
      - name: Set host1_fqdn .. host6_fqdn
        set_fact:
          host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
          host2_fqdn: "{{ 'host2.' + ipaserver_domain }}"
          host3_fqdn: "{{ 'host3.' + ipaserver_domain }}"
          host4_fqdn: "{{ 'host4.' + ipaserver_domain }}"
          host5_fqdn: "{{ 'host5.' + ipaserver_domain }}"
          host6_fqdn: "{{ 'host6.' + ipaserver_domain }}"
    
      - name: Host absent
        ipahost:
          ipaadmin_password: SomeADMINpassword
          ipaapi_context: "{{ ipa_context | default(omit) }}"
          name:
          - "{{ host1_fqdn }}"
          - "{{ host2_fqdn }}"
          - "{{ host3_fqdn }}"
          - "{{ host4_fqdn }}"
          - "{{ host5_fqdn }}"
          - "{{ host6_fqdn }}"
          update_dns: yes
          state: absent
    
      - name: Get IPv4 address prefix from server node
        set_fact:
          ipv4_prefix: "{{ ansible_facts['default_ipv4'].address.split('.')[:-1] |
                           join('.') }}"
    
      - name: Host "{{ host1_fqdn }}" present
        ipahost:
          ipaadmin_password: SomeADMINpassword
          ipaapi_context: "{{ ipa_context | default(omit) }}"
          name: "{{ host1_fqdn }}"
          ip_address: "{{ ipv4_prefix + '.201' }}"
          update_dns: yes
          reverse: no
        register: result
        failed_when: not result.changed or result.failed
    
      - name: Host "{{ host1_fqdn }}" present again
        ipahost:
          ipaadmin_password: SomeADMINpassword
          ipaapi_context: "{{ ipa_context | default(omit) }}"
          name: "{{ host1_fqdn }}"
          ip_address: "{{ ipv4_prefix + '.201' }}"
          update_dns: yes
          reverse: no
        register: result
        failed_when: result.changed or result.failed
    
      - name: Host "{{ host2_fqdn }}" present
        ipahost:
          ipaadmin_password: SomeADMINpassword
          ipaapi_context: "{{ ipa_context | default(omit) }}"
          name: "{{ host2_fqdn }}"
          ip_address: "{{ ipv4_prefix + '.202' }}"
          update_dns: yes
          reverse: no
        register: result