diff options
Diffstat (limited to 'test/integration')
209 files changed, 0 insertions, 5197 deletions
diff --git a/test/integration/targets/cloudscale_common/aliases b/test/integration/targets/cloudscale_common/aliases deleted file mode 100644 index 136c05e0d0..0000000000 --- a/test/integration/targets/cloudscale_common/aliases +++ /dev/null @@ -1 +0,0 @@ -hidden diff --git a/test/integration/targets/cloudscale_common/defaults/main.yml b/test/integration/targets/cloudscale_common/defaults/main.yml deleted file mode 100644 index 293e0c49de..0000000000 --- a/test/integration/targets/cloudscale_common/defaults/main.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -# The image to use for test servers -cloudscale_test_image: 'debian-9' - -# Alternate test image to use if a different image is required -cloudscale_alt_test_image: 'ubuntu-18.04' - -# The flavor to use for test servers -cloudscale_test_flavor: 'flex-2' - -# SSH key to use for test servers -cloudscale_test_ssh_key: | - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible - -# The zone to use to test servers -cloudscale_test_zone: 'lpg1' - -# The region to use to request floating IPs -cloudscale_test_region: 'lpg' diff --git a/test/integration/targets/cloudscale_common/tasks/cleanup_floating_ips.yml b/test/integration/targets/cloudscale_common/tasks/cleanup_floating_ips.yml deleted file mode 100644 index 8b60ab9260..0000000000 --- a/test/integration/targets/cloudscale_common/tasks/cleanup_floating_ips.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -- name: List all floating IPs - uri: - url: 'https://api.cloudscale.ch/v1/floating-ips' - headers: - Authorization: 'Bearer {{ cloudscale_api_token }}' - status_code: 200 - register: floating_ip_list - -- name: Remove all floating IPs created by this test run - cloudscale_floating_ip: - ip: '{{ item.network | ipaddr("address") }}' - state: 'absent' - when: cloudscale_resource_prefix in (item.reverse_ptr | string ) - with_items: '{{ floating_ip_list.json }}' - loop_control: - label: '{{ item.reverse_ptr }} ({{ item.network }})' diff --git a/test/integration/targets/cloudscale_common/tasks/cleanup_server_groups.yml b/test/integration/targets/cloudscale_common/tasks/cleanup_server_groups.yml deleted file mode 100644 index 2bdb9e5939..0000000000 --- a/test/integration/targets/cloudscale_common/tasks/cleanup_server_groups.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -- name: List all server groups - uri: - url: 'https://api.cloudscale.ch/v1/server-groups' - headers: - Authorization: 'Bearer {{ cloudscale_api_token }}' - status_code: 200 - register: server_group_list - -- name: Remove all server groups created by this test run - cloudscale_server_group: - uuid: '{{ item.uuid }}' - state: absent - when: cloudscale_resource_prefix in item.name - with_items: '{{ server_group_list.json }}' - loop_control: - label: '{{ item.name }} ({{ item.uuid }})' diff --git a/test/integration/targets/cloudscale_common/tasks/cleanup_servers.yml b/test/integration/targets/cloudscale_common/tasks/cleanup_servers.yml deleted file mode 100644 index 8fe6798693..0000000000 --- a/test/integration/targets/cloudscale_common/tasks/cleanup_servers.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -- name: List all servers - uri: - url: 'https://api.cloudscale.ch/v1/servers' - headers: - Authorization: 'Bearer {{ cloudscale_api_token }}' - status_code: 200 - register: server_list - -- name: Remove all servers created by this test run - cloudscale_server: - uuid: '{{ item.uuid }}' - state: 'absent' - when: cloudscale_resource_prefix in item.name - with_items: '{{ server_list.json }}' - loop_control: - label: '{{ item.name }} ({{ item.uuid }})' diff --git a/test/integration/targets/cloudscale_common/tasks/cleanup_volumes.yml b/test/integration/targets/cloudscale_common/tasks/cleanup_volumes.yml deleted file mode 100644 index 67cc89bb31..0000000000 --- a/test/integration/targets/cloudscale_common/tasks/cleanup_volumes.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -- name: List all volumes - uri: - url: 'https://api.cloudscale.ch/v1/volumes' - headers: - Authorization: 'Bearer {{ cloudscale_api_token }}' - status_code: 200 - register: volume_list - -- name: Remove all volumes created by this test run - cloudscale_volume: - uuid: '{{ item.uuid }}' - state: 'absent' - when: cloudscale_resource_prefix in item.name - with_items: '{{ volume_list.json }}' - loop_control: - label: '{{ item.name }} ({{ item.uuid }})' diff --git a/test/integration/targets/cloudscale_common/tasks/main.yml b/test/integration/targets/cloudscale_common/tasks/main.yml deleted file mode 100644 index fa0be6eb80..0000000000 --- a/test/integration/targets/cloudscale_common/tasks/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -# Password to use for test server -# This has to be set as a fact, otherwise a new password will be generated -# on every variable access. -- set_fact: - cloudscale_test_password: "{{ lookup('password', '/dev/null length=15 chars=ascii_letters') }}" diff --git a/test/integration/targets/cs_common/aliases b/test/integration/targets/cs_common/aliases deleted file mode 100644 index 136c05e0d0..0000000000 --- a/test/integration/targets/cs_common/aliases +++ /dev/null @@ -1 +0,0 @@ -hidden diff --git a/test/integration/targets/cs_common/defaults/main.yml b/test/integration/targets/cs_common/defaults/main.yml deleted file mode 100644 index 942316bdd4..0000000000 --- a/test/integration/targets/cs_common/defaults/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -cs_resource_prefix: "cs-{{ (ansible_date_time.iso8601_micro | to_uuid).split('-')[0] }}" -cs_common_template: CentOS 5.6 (64-bit) no GUI (Simulator) -cs_common_service_offering: Small Instance -cs_common_zone_adv: Sandbox-simulator-advanced -cs_common_zone_basic: Sandbox-simulator-basic diff --git a/test/integration/targets/prepare_eos_tests/tasks/main.yml b/test/integration/targets/prepare_eos_tests/tasks/main.yml deleted file mode 100644 index 1f2e2fc5b9..0000000000 --- a/test/integration/targets/prepare_eos_tests/tasks/main.yml +++ /dev/null @@ -1,27 +0,0 @@ -- name: Enable Ethernet1 interface and disable switchport - eos_config: - lines: - - no shutdown - - no switchport - parents: int Ethernet1 - become: yes - connection: network_cli - -- name: Enable Ethernet2 interface and disable switchport - eos_config: - lines: - - no shutdown - - no switchport - parents: int Ethernet2 - become: yes - connection: network_cli - -- name: enable eapi - eos_eapi: - http: yes - https: yes - local_http: no - enable_socket: yes - become: yes - connection: network_cli - tags: eapi diff --git a/test/integration/targets/prepare_ios_tests/tasks/main.yml b/test/integration/targets/prepare_ios_tests/tasks/main.yml deleted file mode 100644 index d0970a9b0c..0000000000 --- a/test/integration/targets/prepare_ios_tests/tasks/main.yml +++ /dev/null @@ -1,52 +0,0 @@ ---- - -- name: Ensure we have loopback 888 for testing - ios_config: - src: config.j2 - connection: network_cli - become: yes - -# Some AWS hostnames can be longer than those allowed by the system we are testing -# Truncate the hostname -# http://jinja.pocoo.org/docs/2.9/templates/#truncate -- set_fact: - shorter_hostname: '{{ inventory_hostname_short| truncate(10, True, "") }}' - -- name: "Discover IOS L2/L3 switch type" - ios_command: - commands: ['show version'] - connection: network_cli - become: yes - register: result - -- set_fact: switch_type="" - -- set_fact: switch_type="L2" - when: '"l2" in result.stdout[0]' - -- block: - - name: Set test interface to GigabitEthernet0/1 as we are on Cisco IOS - set_fact: test_interface=GigabitEthernet0/1 - - name: Set test interface 2 to GigabitEthernet0/2 as we are on Cisco IOS - set_fact: test_interface2=GigabitEthernet0/2 - when: "'Cisco IOS' in result.stdout[0]" - -- block: - - name: Set test interface to GigabitEthernet2 as we are on Cisco IOS-XE - set_fact: test_interface=GigabitEthernet2 - - name: Disable autonegotiation on GigabitEthernet2 - ios_config: - lines: - - no negotiation auto - parents: int GigabitEthernet2 - authorize: yes - - - name: Set test interface 2 to GigabitEthernet3 as we are on Cisco IOS-XE - set_fact: test_interface2=GigabitEthernet3 - - name: Disable autonegotiation on GigabitEthernet3 - ios_config: - lines: - - no negotiation auto - parents: int GigabitEthernet3 - authorize: yes - when: "'Cisco IOS-XE' in result.stdout[0]" diff --git a/test/integration/targets/prepare_ios_tests/templates/config.j2 b/test/integration/targets/prepare_ios_tests/templates/config.j2 deleted file mode 100644 index c8eb3457f9..0000000000 --- a/test/integration/targets/prepare_ios_tests/templates/config.j2 +++ /dev/null @@ -1,4 +0,0 @@ -interface Loopback888 - description test for ansible - shutdown - diff --git a/test/integration/targets/prepare_iosxr_tests/tasks/main.yml b/test/integration/targets/prepare_iosxr_tests/tasks/main.yml deleted file mode 100644 index 251506c71c..0000000000 --- a/test/integration/targets/prepare_iosxr_tests/tasks/main.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- name: Ensure we have loopback 888 for testing - iosxr_config: - src: config.j2 - connection: network_cli - -- name: Enable Netconf service - iosxr_netconf: - netconf_port: 830 - netconf_vrf: 'default' - state: present - connection: network_cli - tags: netconf - -# Some AWS hostnames can be longer than those allowed by the system we are testing -# Truncate the hostname -# http://jinja.pocoo.org/docs/2.9/templates/#truncate -- set_fact: - shorter_hostname: '{{ inventory_hostname_short| truncate(10, True, "") }}' diff --git a/test/integration/targets/prepare_iosxr_tests/templates/config.j2 b/test/integration/targets/prepare_iosxr_tests/templates/config.j2 deleted file mode 100644 index c8eb3457f9..0000000000 --- a/test/integration/targets/prepare_iosxr_tests/templates/config.j2 +++ /dev/null @@ -1,4 +0,0 @@ -interface Loopback888 - description test for ansible - shutdown - diff --git a/test/integration/targets/prepare_junos_tests/tasks/main.yml b/test/integration/targets/prepare_junos_tests/tasks/main.yml deleted file mode 100644 index 2cae1f2cd5..0000000000 --- a/test/integration/targets/prepare_junos_tests/tasks/main.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- debug: msg="START prepare_junos_tests/main.yaml" - -- name: Ensure netconf is enabled - junos_netconf: - state: present - connection: network_cli - tags: netconf - -- name: wait for netconf server to come up - delegate_to: localhost - wait_for: - host: "{{ hostvars[item].ansible_host }}" - port: 830 - with_inventory_hostnames: junos diff --git a/test/integration/targets/prepare_nios_tests/tasks/main.yml b/test/integration/targets/prepare_nios_tests/tasks/main.yml deleted file mode 100644 index e69de29bb2..0000000000 --- a/test/integration/targets/prepare_nios_tests/tasks/main.yml +++ /dev/null diff --git a/test/integration/targets/prepare_nuage_tests/tasks/main.yml b/test/integration/targets/prepare_nuage_tests/tasks/main.yml deleted file mode 100644 index 11408971c3..0000000000 --- a/test/integration/targets/prepare_nuage_tests/tasks/main.yml +++ /dev/null @@ -1,19 +0,0 @@ -- block: - - name: Install Nuage VSD API Simulator - pip: - name: nuage-vsd-sim - - - name: Start Nuage VSD API Simulator - shell: "(cd /; nuage-vsd-sim >/dev/null 2>&1)" - async: 1800 - poll: 0 - - - name: Wait for API to be ready - uri: - url: http://localhost:5000 - register: api - delay: 3 - retries: 10 - until: api.status == 200 - - when: "ansible_python_version is version('2.7', '>=')" diff --git a/test/integration/targets/prepare_nxos_tests/tasks/main.yml b/test/integration/targets/prepare_nxos_tests/tasks/main.yml deleted file mode 100644 index 8704cf4861..0000000000 --- a/test/integration/targets/prepare_nxos_tests/tasks/main.yml +++ /dev/null @@ -1,174 +0,0 @@ ---- -- block: - - name: Enable Feature Privilege - nxos_config: - lines: - - feature privilege - connection: network_cli - ignore_errors: yes - - - name: Enable Feature NXAPI - nxos_nxapi: - state: present - connection: network_cli - - - name: Enable lldp - nxos_config: - lines: - - feature lldp - connection: network_cli - ignore_errors: yes - - # Gather the list of interfaces on this device and make the list - # available for integration tests that need them. - # - # Usage in integration test playbook: - # - # - set_fact: - # testint: "{{ nxos_int1 }}" - # - # - name: "Interface selected for this test" - # debug: msg="{{ testint }}" - - - name: "Collect interface list" - nxos_command: - commands: ['show interface brief | json'] - connection: network_cli - register: intout - - - set_fact: - intdataraw: "{{ intout.stdout_lines[0]['TABLE_interface']['ROW_interface'] }}" - - - set_fact: - nxos_int1: "{{ intdataraw[1].interface }}" - - - set_fact: - nxos_int2: "{{ intdataraw[2].interface }}" - - - set_fact: - nxos_int3: "{{ intdataraw[3].interface }}" - - # Get image version information for this device - - name: "Gather image version info" - nxos_command: - commands: ['show version | json'] - connection: network_cli - register: nxos_version_output - - - set_fact: - image_version: "{{ nxos_version_output.stdout[0]['kickstart_ver_str'] }}" - - # Get platform information for this device - # - # Usage in integration test playbook: - # - # - name: "nxos platform " - # debug: msg="{{ platform }}" - # - - name: "Gather platform info" - nxos_command: - commands: ['show inventory | json'] - connection: network_cli - register: nxos_inventory_output - - - set_fact: - platform: "{{ nxos_inventory_output.stdout_lines[0]['TABLE_inv']['ROW_inv'][0]['productid'].split('-')[0] }}" - - - set_fact: - chassis_type: "{{ nxos_inventory_output.stdout_lines[0]['TABLE_inv']['ROW_inv'][0]['productid'].split('-')[1] }}" - - # Check if platform is fretta - - set_fact: - fretta: "{% for row in nxos_inventory_output.stdout_lines[0]['TABLE_inv']['ROW_inv'] if '-R' in row['productid'] %}true{% endfor %}" - when: platform is match("N9K|N3K") - - # Set platform to N3K-F for fretta - - set_fact: - platform: "N3K-F" - when: ( platform is match("N3K")) and ( fretta is search("true")) - - # Set platform to N9K-F for fretta - - set_fact: - platform: "N9K-F" - when: ( platform is match("N9K")) and ( fretta is search("true")) - - # Check if platform is titanium - - set_fact: - titanium: "false" - - - set_fact: - titanium: "{% for row in nxos_inventory_output.stdout_lines[0]['TABLE_inv']['ROW_inv'] if 'NX-OSv' in row['desc']%}true{% endfor %}" - when: platform is match("N7K") - - # Set platform to N35 for N3k-35xx - - set_fact: - platform: "N35" - when: ( chassis_type is search("C35")) - - # Set platform to N35NG for N3k-35xx running image version - # 7.0(3)I7 or later. NG(Next Gen) - - set_fact: - platform: "N35NG" - when: ( chassis_type is search("C35")) and image_version is search("7.0\(3\)I7") - - # Set platform to N3L(N3K Legacy) for C3048 platform. - - set_fact: - platform: "N3L" - when: ( chassis_type is search("C3048")) - - # Create matrix of simple keys based on platform - # and image version for use within test playbooks. - - set_fact: - imagetag: "" - - - set_fact: - imagemr: "" - - # Examples - # 8.0(1) - # 7.3(0)D1(1) - # 7.0(3)IHD8(1) - - set_fact: - major_version: "{{ image_version[0:3] }}" - - - set_fact: - imagetag: "{{ image_version[0:3] }}" - when: image_version is search("\d\.\d\(\d\)") - - - set_fact: - imagetag: "{{ image_version[6:8] }}" - when: image_version is search("\d\.\d\(\d\)\S\S\(\d\)") - - - set_fact: - imagetag: "{{ image_version[6:10] }}" - when: image_version is search("\d\.\d\(\d\)\S\S\S\S\(\d\)") - - - set_fact: - imagemr: "{{ image_version[4:5] }}" - when: image_version is search("\d\.\d\(\d\)") - - - set_fact: - imagemr: "{{ image_version[9:10] }}" - when: image_version is search("\d\.\d\(\d\)\S\S\(\d\)") - - - set_fact: - imagemr: "{{ image_version[11:12] }}" - when: image_version is search("\d\.\d\(\d\)\S\S\S\S\(\d\)") - - - debug: - msg: "IMAGE VERSION {{ image_version }}" - - - debug: - msg: "IMAGE TAG {{ imagetag }}" - - - debug: - msg: "IMAGE MR {{ imagemr }}" - - - set_fact: - ipv6_supported: "true" - - - set_fact: - ipv6_supported: "false" - when: platform is match("N35") - - when: prepare_nxos_tests_task | default(True) | bool diff --git a/test/integration/targets/prepare_ovs_tests/tasks/main.yml b/test/integration/targets/prepare_ovs_tests/tasks/main.yml deleted file mode 100644 index 23e22f537b..0000000000 --- a/test/integration/targets/prepare_ovs_tests/tasks/main.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -# No easy way to know OS type without python or without ansible facts. -# Run below raw commands and one would succeed with apt/yum on debian/centos -- name: Install python - raw: - test -e /usr/bin/python || (apt-get -y update && apt-get install -y python-minimal) - become: yes - ignore_errors: yes - -- name: Install python - raw: - test -e /usr/bin/python || (yum -y update && yum install -y python) - become: yes - ignore_errors: yes - -# network-integration test are ran with gather_facts: no -# We need to explicitly call setup so ansible_distribution is set - -- name: Gather facts - setup: - become: yes - -- name: Install openvswitch-switch package if we are on Ubuntu - apt: - name: openvswitch-switch - state: present - update_cache: yes - become: yes - when: ansible_distribution == 'Ubuntu' - -- name: Install openvswitch package if we are on Fedora - yum: - name: openvswitch - state: installed - update_cache: yes - become: yes - when: ansible_distribution == 'Fedora' diff --git a/test/integration/targets/prepare_sros_tests/tasks/main.yml b/test/integration/targets/prepare_sros_tests/tasks/main.yml deleted file mode 100644 index 352484edd5..0000000000 --- a/test/integration/targets/prepare_sros_tests/tasks/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- debug: msg="START prepare_sros_tests/main.yaml" - -- name: wait until everything is ready to go - pause: - seconds: 1 diff --git a/test/integration/targets/prepare_vmware_tests/meta/main.yml b/test/integration/targets/prepare_vmware_tests/meta/main.yml deleted file mode 100644 index 61d3ffe4f9..0000000000 --- a/test/integration/targets/prepare_vmware_tests/meta/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -allow_duplicates: true diff --git a/test/integration/targets/prepare_vmware_tests/tasks/init_real_lab.yml b/test/integration/targets/prepare_vmware_tests/tasks/init_real_lab.yml deleted file mode 100644 index 9450084fd1..0000000000 --- a/test/integration/targets/prepare_vmware_tests/tasks/init_real_lab.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -- include_tasks: teardown_with_esxi.yml - when: esxi_hosts|length > 0 -- include_tasks: teardown.yml - -- when: setup_esxi_instance is not defined - block: - - include_tasks: setup_datacenter.yml - - include_tasks: setup_cluster.yml - - include_tasks: setup_attach_hosts.yml - when: setup_attach_host is defined - - include_tasks: setup_datastore.yml - when: setup_datastore is defined - - include_tasks: setup_virtualmachines.yml - when: setup_virtualmachines is defined - - include_tasks: setup_switch.yml - when: setup_switch is defined - - include_tasks: setup_dvswitch.yml - when: setup_dvswitch is defined - - include_tasks: setup_resource_pool.yml - when: setup_resource_pool is defined - - include_tasks: setup_category.yml - when: setup_category is defined - - include_tasks: setup_tag.yml - when: setup_tag is defined - - include_tasks: setup_content_library.yml - when: setup_content_library is defined - - include_tasks: setup_dvs_portgroup.yml - when: setup_dvs_portgroup is defined diff --git a/test/integration/targets/prepare_vmware_tests/tasks/init_vcsim.yml b/test/integration/targets/prepare_vmware_tests/tasks/init_vcsim.yml deleted file mode 100644 index bfb9ef6db7..0000000000 --- a/test/integration/targets/prepare_vmware_tests/tasks/init_vcsim.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- -- name: load vars - include_vars: - file: vcsim.yml - -- name: kill vcsim - uri: - url: http://{{ vcsim }}:5000/killall - -- name: start vcsim (all dressed) - uri: - url: http://{{ vcsim }}:5000/spawn?cluster=1&folder=1&ds=2 - register: vcsim_instance - when: setup_esxi_instance is not defined - -- name: start vcsim (ESXi only) - uri: - url: http://{{ vcsim }}:5000/spawn?esx=1 - register: vcsim_instance - when: setup_esxi_instance is defined - -# - name: get a list of Hosts from vcsim -# uri: -# url: http://{{ vcsim }}:5000/govc_find?filter=H -# register: vcsim_host_list - -# - name: get a list of Hosts from vcsim -# uri: -# url: http://{{ vcsim }}:5000/govc_find?filter=F -# register: vcsim_host_folder -# - debug: var=vcsim_host_folder - -- set_fact: - vcenter_hostname: "{{ vcsim }}" - vcenter_username: "user" - vcenter_password: "pass" - - -- name: set state to poweroff on all VMs - vmware_guest: - name: "{{ item.name }}" - state: poweredoff - with_items: "{{ virtual_machines + virtual_machines_in_cluster }}" - register: poweroff_d1_c1_f0 diff --git a/test/integration/targets/prepare_vmware_tests/tasks/main.yml b/test/integration/targets/prepare_vmware_tests/tasks/main.yml deleted file mode 100644 index 91a6b9ca09..0000000000 --- a/test/integration/targets/prepare_vmware_tests/tasks/main.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- - -- name: load vmware common vars - include_vars: - file: common.yml - -- when: vcsim is not defined - block: - - when: esxi1_hostname is not defined and esxi2_hostname is not defined - include_vars: - file: vcenter_only.yml - - - when: esxi1_hostname is defined and esxi2_hostname is not defined - include_vars: - file: vcenter_1esxi.yml - - - when: esxi1_hostname is defined and esxi2_hostname is defined - include_vars: - file: vcenter_2esxi.yml - - - when: vcsim is not defined - include_tasks: init_real_lab.yml - -- when: vcsim is defined - include_tasks: init_vcsim.yml diff --git a/test/integration/targets/prepare_vmware_tests/tasks/setup_attach_hosts.yml b/test/integration/targets/prepare_vmware_tests/tasks/setup_attach_hosts.yml deleted file mode 100644 index 6ca19b95b5..0000000000 --- a/test/integration/targets/prepare_vmware_tests/tasks/setup_attach_hosts.yml +++ /dev/null @@ -1,30 +0,0 @@ -- fail: - msg: "No ESXi hosts defined. esxi_hosts is empty." - when: "esxi_hosts|length == 0" - -- name: Add ESXi Hosts to vCenter - vmware_host: - datacenter_name: '{{ dc1 }}' - cluster_name: '{{ ccr1 }}' - esxi_hostname: '{{ item }}' - esxi_username: '{{ esxi_user }}' - esxi_password: '{{ esxi_password }}' - state: add_or_reconnect - with_items: "{{ esxi_hosts }}" - -- name: Disable the Maintenance Mode - vmware_maintenancemode: - esxi_hostname: '{{ item }}' - state: absent - with_items: "{{ esxi_hosts }}" - -- name: Add Management Network VM Portgroup - vmware_portgroup: - hostname: '{{ item }}' - username: '{{ esxi_user }}' - password: '{{ esxi_password }}' - esxi_hostname: 'item' - switch: "vSwitch0" - portgroup: VM Network - validate_certs: no - with_items: "{{ esxi_hosts }}" diff --git a/test/integration/targets/prepare_vmware_tests/tasks/setup_category.yml b/test/integration/targets/prepare_vmware_tests/tasks/setup_category.yml deleted file mode 100644 index bfd680172c..0000000000 --- a/test/integration/targets/prepare_vmware_tests/tasks/setup_category.yml +++ /dev/null @@ -1,5 +0,0 @@ -- name: Create a category for cluster - vmware_category: - category_name: '{{ cluster_category }}' - category_description: '{{ cluster_category }} description' - state: present diff --git a/test/integration/targets/prepare_vmware_tests/tasks/setup_cluster.yml b/test/integration/targets/prepare_vmware_tests/tasks/setup_cluster.yml deleted file mode 100644 index 81653a5377..0000000000 --- a/test/integration/targets/prepare_vmware_tests/tasks/setup_cluster.yml +++ /dev/null @@ -1,10 +0,0 @@ -- name: Create Cluster - vmware_cluster: - datacenter_name: '{{ dc1 }}' - cluster_name: '{{ ccr1 }}' - -- name: Enable DRS on Cluster - vmware_cluster_drs: - datacenter_name: '{{ dc1 }}' - cluster_name: '{{ ccr1 }}' - enable_drs: yes diff --git a/test/integration/targets/prepare_vmware_tests/tasks/setup_content_library.yml b/test/integration/targets/prepare_vmware_tests/tasks/setup_content_library.yml deleted file mode 100644 index 26affd53fa..0000000000 --- a/test/integration/targets/prepare_vmware_tests/tasks/setup_content_library.yml +++ /dev/null @@ -1,7 +0,0 @@ -- name: Create Content Library - vmware_content_library_manager: - library_name: test-content-lib - library_description: 'Library created by the prepare_vmware_tests role' - library_type: local - datastore_name: '{{ rw_datastore }}' - state: present diff --git a/test/integration/targets/prepare_vmware_tests/tasks/setup_datacenter.yml b/test/integration/targets/prepare_vmware_tests/tasks/setup_datacenter.yml deleted file mode 100644 index a5f3eafe51..0000000000 --- a/test/integration/targets/prepare_vmware_tests/tasks/setup_datacenter.yml +++ /dev/null @@ -1,11 +0,0 @@ -- name: Create Datacenter - vmware_datacenter: - datacenter_name: '{{ dc1 }}' - state: present - -- name: Create a VM folder on given Datacenter - vcenter_folder: - datacenter: '{{ dc1 }}' - folder_name: '{{ f0 }}' - folder_type: vm - state: present diff --git a/test/integration/targets/prepare_vmware_tests/tasks/setup_datastore.yml b/test/integration/targets/prepare_vmware_tests/tasks/setup_datastore.yml deleted file mode 100644 index 5a62816016..0000000000 --- a/test/integration/targets/prepare_vmware_tests/tasks/setup_datastore.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -- name: Mount NFS (ro_datastore) datastores to ESXi - vmware_host_datastore: - hostname: '{{ item }}' - username: '{{ esxi_user }}' - password: '{{ esxi_password }}' - datastore_name: '{{ ro_datastore }}' - datastore_type: '{{ infra.datastores[ro_datastore].type }}' - nfs_server: '{{ infra.datastores[ro_datastore].server }}' - nfs_path: '{{ infra.datastores[ro_datastore].path }}' - nfs_ro: '{{ infra.datastores[ro_datastore].ro }}' - state: present - validate_certs: no - with_items: "{{ esxi_hosts }}" - -- name: Mount NFS (rw_datastore) datastores on the ESXi - vmware_host_datastore: - hostname: '{{ item }}' - username: '{{ esxi_user }}' - password: '{{ esxi_password }}' - datastore_name: '{{ rw_datastore }}' - datastore_type: '{{ infra.datastores[rw_datastore].type }}' - nfs_server: '{{ infra.datastores[rw_datastore].server }}' - nfs_path: '{{ infra.datastores[rw_datastore].path }}' - nfs_ro: '{{ infra.datastores[rw_datastore].ro }}' - state: present - validate_certs: no - with_items: "{{ esxi_hosts }}" - -- vmware_host_scanhba: - refresh_storage: true - cluster_name: '{{ ccr1 }}' - -- name: The vcenter needs a bit of time to refresh the DS list - vmware_datastore_info: - validate_certs: false - cluster: '{{ ccr1 }}' - register: setup_datastore_datatstore_info - failed_when: setup_datastore_datatstore_info.datastores|selectattr('type', 'equalto', 'NFS')|list|length != 2 - until: setup_datastore_datatstore_info is succeeded - retries: 60 - delay: 1 diff --git a/test/integration/targets/prepare_vmware_tests/tasks/setup_dvs_portgroup.yml b/test/integration/targets/prepare_vmware_tests/tasks/setup_dvs_portgroup.yml deleted file mode 100644 index c0e14fe539..0000000000 --- a/test/integration/targets/prepare_vmware_tests/tasks/setup_dvs_portgroup.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- name: create basic DVS portgroup - vmware_dvs_portgroup: - switch_name: "{{ dvswitch1 }}" - portgroup_name: '{{ dvpg1 }}' - vlan_id: 0 - num_ports: 32 - portgroup_type: earlyBinding - state: present - -- name: Create the DVS PG with slash in name - vmware_dvs_portgroup: - portgroup_name: '{{ dvpg_with_slash }}' - switch_name: '{{ dvswitch1 }}' - vlan_id: 0 - num_ports: 120 - portgroup_type: earlyBinding - state: present diff --git a/test/integration/targets/prepare_vmware_tests/tasks/setup_dvswitch.yml b/test/integration/targets/prepare_vmware_tests/tasks/setup_dvswitch.yml deleted file mode 100644 index ba36a46196..0000000000 --- a/test/integration/targets/prepare_vmware_tests/tasks/setup_dvswitch.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- name: Create the DVSwitch - vmware_dvswitch: - datacenter_name: '{{ dc1 }}' - switch_name: '{{ dvswitch1 }}' - switch_version: 6.0.0 - mtu: 9000 - uplink_quantity: 2 - discovery_proto: lldp - discovery_operation: both - state: present -- name: Attach the hosts to the DVSwitch - vmware_dvs_host: - esxi_hostname: "{{ item }}" - switch_name: '{{ dvswitch1 }}' - vmnics: - - vmnic1 - state: present - with_items: "{{ esxi_hosts }}" - when: setup_attach_host is defined diff --git a/test/integration/targets/prepare_vmware_tests/tasks/setup_resource_pool.yml b/test/integration/targets/prepare_vmware_tests/tasks/setup_resource_pool.yml deleted file mode 100644 index 060785d17a..0000000000 --- a/test/integration/targets/prepare_vmware_tests/tasks/setup_resource_pool.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- name: Add resource pool to vCenter - vmware_resource_pool: - datacenter: '{{ dc1 }}' - cluster: '{{ ccr1 }}' - resource_pool: DC0_C0_RP1 - mem_shares: normal - mem_limit: -1 - mem_reservation: 0 - mem_expandable_reservations: yes - cpu_shares: normal - cpu_limit: -1 - cpu_reservation: 0 - cpu_expandable_reservations: yes - state: present diff --git a/test/integration/targets/prepare_vmware_tests/tasks/setup_switch.yml b/test/integration/targets/prepare_vmware_tests/tasks/setup_switch.yml deleted file mode 100644 index c63a28c52b..0000000000 --- a/test/integration/targets/prepare_vmware_tests/tasks/setup_switch.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Add a VMware vSwitchs - vmware_vswitch: - esxi_hostname: '{{ item }}' - switch_name: "{{ switch1 }}" - state: present - with_items: "{{ esxi_hosts }}" diff --git a/test/integration/targets/prepare_vmware_tests/tasks/setup_tag.yml b/test/integration/targets/prepare_vmware_tests/tasks/setup_tag.yml deleted file mode 100644 index 31b495c0f4..0000000000 --- a/test/integration/targets/prepare_vmware_tests/tasks/setup_tag.yml +++ /dev/null @@ -1,15 +0,0 @@ -- name: Get Category facts - vmware_category_info: - register: cat_info - -- name: Get Category id for {{ cluster_category }} - set_fact: - cluster_category_id: "{{ cat_info.tag_category_info[0].category_id }}" - -- name: Create a tag for cluster - vmware_tag: - category_id: '{{ cluster_category_id }}' - tag_name: '{{ cluster_tag }}' - tag_description: '{{ cluster_tag }} Description' - state: present - when: cluster_category_id is defined diff --git a/test/integration/targets/prepare_vmware_tests/tasks/setup_virtualmachines.yml b/test/integration/targets/prepare_vmware_tests/tasks/setup_virtualmachines.yml deleted file mode 100644 index 8368f4b813..0000000000 --- a/test/integration/targets/prepare_vmware_tests/tasks/setup_virtualmachines.yml +++ /dev/null @@ -1,46 +0,0 @@ ---- -- name: Create VMs - vmware_guest: - datacenter: "{{ dc1 }}" - folder: '{{ item.folder }}' - name: '{{ item.name }}' - state: poweredoff - guest_id: debian8_64Guest - disk: - - size_gb: 1 - type: thin - datastore: '{{ rw_datastore }}' - hardware: - memory_mb: 128 - num_cpus: 1 - scsi: paravirtual - cdrom: - type: iso - iso_path: "[{{ ro_datastore }}] fedora.iso" - networks: - - name: VM Network - with_items: '{{ virtual_machines }}' - - -- name: Create VMs in cluster - vmware_guest: - datacenter: "{{ dc1 }}" - folder: '{{ item.folder }}' - cluster: '{{ item.cluster }}' - name: '{{ item.name }}' - state: poweredoff - guest_id: debian8_64Guest - disk: - - size_gb: 1 - type: thin - datastore: '{{ rw_datastore }}' - hardware: - memory_mb: 128 - num_cpus: 1 - scsi: paravirtual - cdrom: - type: iso - iso_path: "[{{ ro_datastore }}] fedora.iso" - networks: - - name: VM Network - with_items: '{{ virtual_machines_in_cluster }}' diff --git a/test/integration/targets/prepare_vmware_tests/tasks/teardown.yml b/test/integration/targets/prepare_vmware_tests/tasks/teardown.yml deleted file mode 100644 index aba390592e..0000000000 --- a/test/integration/targets/prepare_vmware_tests/tasks/teardown.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -- name: Delete a datastore cluster to datacenter - vmware_datastore_cluster: - datacenter_name: "{{ dc1 }}" - datastore_cluster_name: '{{ item }}' - state: absent - with_items: - - DSC1 - - DSC2 - ignore_errors: yes - -- name: Remove the datacenter - vmware_datacenter: - datacenter_name: '{{ item }}' - state: absent - when: vcsim is not defined - with_items: - - '{{ dc1 }}' - - datacenter_0001 - -- name: kill vcsim - uri: - url: "http://{{ vcsim }}:5000/killall" - when: vcsim is defined diff --git a/test/integration/targets/prepare_vmware_tests/tasks/teardown_with_esxi.yml b/test/integration/targets/prepare_vmware_tests/tasks/teardown_with_esxi.yml deleted file mode 100644 index 2707847ef2..0000000000 --- a/test/integration/targets/prepare_vmware_tests/tasks/teardown_with_esxi.yml +++ /dev/null @@ -1,96 +0,0 @@ ---- -- name: Clean up the firewall rules - vmware_host_firewall_manager: - cluster_name: '{{ ccr1 }}' - rules: - - name: vvold - enabled: False - - name: CIMHttpServer - enabled: True - allowed_hosts: - all_ip: True - - name: NFC - enabled: True - allowed_hosts: - all_ip: True - ignore_errors: yes - -- name: Remove the VM prepared by prepare_vmware_tests - vmware_guest: - name: "{{ item.name }}" - force: yes - state: absent - with_items: '{{ virtual_machines + virtual_machines_in_cluster }}' - -- name: Remove the test_vm* VMs - vmware_guest: - name: "{{ item }}" - force: yes - state: absent - with_items: - - test_vm1 - - test_vm2 - - test_vm3 - -- name: Remove the DVS portgroups - vmware_dvs_portgroup: - switch_name: "{{ dvswitch1 }}" - portgroup_name: '{{ item }}' - vlan_id: 0 - num_ports: 32 - portgroup_type: earlyBinding - state: absent - loop: - - DC0_DVPG0 - - DVPG/1 - ignore_errors: yes - -- name: Remove the DVSwitch - vmware_dvswitch: - datacenter_name: '{{ dc1 }}' - state: absent - switch_name: '{{ item }}' - loop: - - '{{ dvswitch1 }}' - - dvswitch_0001 - - dvswitch_0002 - ignore_errors: yes - -- name: Remove the vSwitches - vmware_vswitch: - hostname: '{{ item }}' - username: '{{ esxi_user }}' - password: '{{ esxi_password }}' - switch_name: "{{ switch1 }}" - state: absent - with_items: "{{ esxi_hosts }}" - ignore_errors: yes - -- name: Remove ESXi Hosts to vCenter - vmware_host: - datacenter_name: '{{ dc1 }}' - cluster_name: ccr1 - esxi_hostname: '{{ item }}' - esxi_username: '{{ esxi_user }}' - esxi_password: '{{ esxi_password }}' - state: absent - with_items: "{{ esxi_hosts }}" - ignore_errors: yes - -- name: Umount NFS datastores to ESXi (1/2) - vmware_host_datastore: - hostname: '{{ item }}' - username: '{{ esxi_user }}' - password: '{{ esxi_password }}' - datastore_name: '{{ ro_datastore }}' - state: absent - with_items: "{{ esxi_hosts }}" - -- name: Umount NFS datastores to ESXi (2/2) - vmware_host_datastore: - hostname: '{{ item }}' - username: '{{ esxi_user }}' - password: '{{ esxi_password }}' - datastore_name: '{{ rw_datastore }}' - state: absent - with_items: "{{ esxi_hosts }}" diff --git a/test/integration/targets/prepare_vmware_tests/vars/common.yml b/test/integration/targets/prepare_vmware_tests/vars/common.yml deleted file mode 100644 index bfe5a30fb5..0000000000 --- a/test/integration/targets/prepare_vmware_tests/vars/common.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -dc1: DC0 -ccr1: DC0_C0 -f0: F0 -switch1: switch1 -esxi1: '{{ esxi_hosts[0] }}' -esxi2: '{{ esxi_hosts[1] }}' -esxi3: '{{ esxi_hosts[2] }}' -dvswitch1: DVS0 -esxi_user: root -dvpg1: DC0_DVPG0 -dvpg_with_slash: DVPG/1 diff --git a/test/integration/targets/prepare_vmware_tests/vars/vcenter_1esxi.yml b/test/integration/targets/prepare_vmware_tests/vars/vcenter_1esxi.yml deleted file mode 100644 index 45e94331f9..0000000000 --- a/test/integration/targets/prepare_vmware_tests/vars/vcenter_1esxi.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -esxi_hosts: - - esxi1.test -rw_datastore: rw_datastore -ro_datastore: ro_datastore -esxi_password: '{{ esxi1_password }}' -esxi_user: '{{ esxi1_username }}' -infra: - datastores: - rw_datastore: - type: nfs - server: datastore.test - path: /srv/share/vms - ro: false - ro_datastore: - type: nfs - server: datastore.test - path: /srv/share/isos - ro: true -virtual_machines: - - name: DC0_H0_VM0 - folder: '{{ f0 }}' - - name: DC0_H0_VM1 - folder: '{{ f0 }}' -virtual_machines_in_cluster: - - name: DC0_C0_RP0_VM0 - folder: '{{ f0 }}' - cluster: '{{ ccr1 }}' - - name: DC0_C0_RP0_VM1 - folder: '{{ f0 }}' - cluster: '{{ ccr1 }}' -cluster_tag: test_cluster_tag_0001 -cluster_category: test_cluster_cat_0001 diff --git a/test/integration/targets/prepare_vmware_tests/vars/vcenter_2esxi.yml b/test/integration/targets/prepare_vmware_tests/vars/vcenter_2esxi.yml deleted file mode 100644 index 6b0203b4ac..0000000000 --- a/test/integration/targets/prepare_vmware_tests/vars/vcenter_2esxi.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -esxi_hosts: - - esxi1.test - - esxi2.test -rw_datastore: rw_datastore -ro_datastore: ro_datastore -esxi_password: '{{ esxi1_password }}' -esxi_user: '{{ esxi1_username }}' -infra: - datastores: - rw_datastore: - type: nfs - server: datastore.test - path: /srv/share/vms - ro: false - ro_datastore: - type: nfs - server: datastore.test - path: /srv/share/isos - ro: true -virtual_machines: - - name: DC0_H0_VM0 - folder: '{{ f0 }}' - - name: DC0_H0_VM1 - folder: '{{ f0 }}' -virtual_machines_in_cluster: - - name: DC0_C0_RP0_VM0 - folder: '{{ f0 }}' - cluster: '{{ ccr1 }}' - - name: DC0_C0_RP0_VM1 - folder: '{{ f0 }}' - cluster: '{{ ccr1 }}' -cluster_tag: test_cluster_tag_0001 -cluster_category: test_cluster_cat_0001 diff --git a/test/integration/targets/prepare_vmware_tests/vars/vcenter_only.yml b/test/integration/targets/prepare_vmware_tests/vars/vcenter_only.yml deleted file mode 100644 index 58560b5619..0000000000 --- a/test/integration/targets/prepare_vmware_tests/vars/vcenter_only.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -esxi_hosts: [] -infra: -virtual_machines: [] -virtual_machines_in_cluster: [] -#esxi_password: ''
\ No newline at end of file diff --git a/test/integration/targets/prepare_vmware_tests/vars/vcsim.yml b/test/integration/targets/prepare_vmware_tests/vars/vcsim.yml deleted file mode 100644 index ee783c1038..0000000000 --- a/test/integration/targets/prepare_vmware_tests/vars/vcsim.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -esxi_hosts: - - DC0_C0_H0 - - DC0_C0_H1 - - DC0_C0_H2 -esxi_password: 'pass' -esxi_user: 'user' -rw_datastore: LocalDS_0 -ro_datastore: LocalDS_1 -virtual_machines: - - name: DC0_H0_VM0 - folder: /F0/DC0/vm/F0 - - name: DC0_H0_VM1 - folder: /F0/DC0/vm/F0 -virtual_machines_in_cluster: - - name: DC0_C0_RP0_VM0 - cluster: '{{ ccr1 }}' - - name: DC0_C0_RP0_VM1 - cluster: '{{ ccr1 }}' diff --git a/test/integration/targets/prepare_vyos_tests/tasks/main.yaml b/test/integration/targets/prepare_vyos_tests/tasks/main.yaml deleted file mode 100644 index c2e0cea6ef..0000000000 --- a/test/integration/targets/prepare_vyos_tests/tasks/main.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- name: Ensure required interfaces are present in running-config - cli_config: - config: "{{ lines }}" - vars: - lines: | - set interfaces ethernet eth0 address dhcp - set interfaces ethernet eth0 speed auto - set interfaces ethernet eth0 duplex auto - set interfaces ethernet eth1 - set interfaces ethernet eth2 - delete interfaces loopback lo - ignore_errors: true diff --git a/test/integration/targets/prepare_win_tests/meta/main.yml b/test/integration/targets/prepare_win_tests/meta/main.yml deleted file mode 100644 index cf5427b608..0000000000 --- a/test/integration/targets/prepare_win_tests/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- - -allow_duplicates: yes diff --git a/test/integration/targets/prepare_win_tests/tasks/main.yml b/test/integration/targets/prepare_win_tests/tasks/main.yml deleted file mode 100644 index e87b614b22..0000000000 --- a/test/integration/targets/prepare_win_tests/tasks/main.yml +++ /dev/null @@ -1,29 +0,0 @@ -# test code for the windows versions of copy, file and template module -# originally -# (c) 2014, Michael DeHaan <michael.dehaan@gmail.com> - -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see <http://www.gnu.org/licenses/>. - - -- name: clean out the test directory - win_file: name={{win_output_dir|mandatory}} state=absent - tags: - - prepare - -- name: create the test directory - win_file: name={{win_output_dir}} state=directory - tags: - - prepare diff --git a/test/integration/targets/setup_acme/tasks/main.yml b/test/integration/targets/setup_acme/tasks/main.yml deleted file mode 100644 index 6f4f2ec02b..0000000000 --- a/test/integration/targets/setup_acme/tasks/main.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- name: register openssl version - shell: "openssl version | cut -d' ' -f2" - register: openssl_version - -- name: register cryptography version - command: "{{ ansible_python.executable }} -c 'import cryptography; print(cryptography.__version__)'" - register: cryptography_version - -- debug: msg="ACME test container IP is {{ acme_host }}; OpenSSL version is {{ openssl_version.stdout }}; cryptography version is {{ cryptography_version.stdout }}" diff --git a/test/integration/targets/setup_acme/tasks/obtain-cert.yml b/test/integration/targets/setup_acme/tasks/obtain-cert.yml deleted file mode 100644 index 98f5f80440..0000000000 --- a/test/integration/targets/setup_acme/tasks/obtain-cert.yml +++ /dev/null @@ -1,140 +0,0 @@ ---- -## PRIVATE KEY ################################################################################ -- name: ({{ certgen_title }}) Create cert private key (RSA) - command: "openssl genrsa -out {{ output_dir }}/{{ certificate_name }}.key {{ rsa_bits if key_type == 'rsa' else 2048 }}" - when: "key_type == 'rsa'" -- name: ({{ certgen_title }}) Create cert private key (ECC 256) - command: openssl ecparam -name prime256v1 -genkey -out {{ output_dir }}/{{ certificate_name }}.key - when: "key_type == 'ec256'" -- name: ({{ certgen_title }}) Create cert private key (ECC 384) - command: openssl ecparam -name secp384r1 -genkey -out {{ output_dir }}/{{ certificate_name }}.key - when: "key_type == 'ec384'" -- name: ({{ certgen_title }}) Create cert private key (ECC 512) - command: openssl ecparam -name secp521r1 -genkey -out {{ output_dir }}/{{ certificate_name }}.key - when: "key_type == 'ec521'" -## CSR ######################################################################################## -- name: ({{ certgen_title }}) Create cert CSR - openssl_csr: - path: "{{ output_dir }}/{{ certificate_name }}.csr" - privatekey_path: "{{ output_dir }}/{{ certificate_name }}.key" - subject_alt_name: "{{ subject_alt_name }}" - subject_alt_name_critical: "{{ subject_alt_name_critical }}" -## ACME STEP 1 ################################################################################ -- name: ({{ certgen_title }}) Obtain cert, step 1 - acme_certificate: - select_crypto_backend: "{{ select_crypto_backend }}" - acme_version: 2 - acme_directory: https://{{ acme_host }}:14000/dir - validate_certs: no - account_key: "{{ (output_dir ~ '/' ~ account_key ~ '.pem') if account_key_content is not defined else omit }}" - account_key_content: "{{ account_key_content | default(omit) }}" - modify_account: "{{ modify_account }}" - csr: "{{ output_dir }}/{{ certificate_name }}.csr" - dest: "{{ output_dir }}/{{ certificate_name }}.pem" - fullchain_dest: "{{ output_dir }}/{{ certificate_name }}-fullchain.pem" - chain_dest: "{{ output_dir }}/{{ certificate_name }}-chain.pem" - challenge: "{{ challenge }}" - deactivate_authzs: "{{ deactivate_authzs }}" - force: "{{ force }}" - remaining_days: "{{ remaining_days }}" - terms_agreed: "{{ terms_agreed }}" - account_email: "{{ account_email }}" - register: challenge_data -- name: ({{ certgen_title }}) Print challenge data - debug: - var: challenge_data -- name: ({{ certgen_title }}) Create HTTP challenges - uri: - url: "http://{{ acme_host }}:5000/http/{{ item.key }}/{{ item.value['http-01'].resource[('.well-known/acme-challenge/'|length):] }}" - method: PUT - body_format: raw - body: "{{ item.value['http-01'].resource_value }}" - headers: - content-type: "application/octet-stream" - with_dict: "{{ challenge_data.challenge_data }}" - when: "challenge_data is changed and challenge == 'http-01'" -- name: ({{ certgen_title }}) Create DNS challenges - uri: - url: "http://{{ acme_host }}:5000/dns/{{ item.key }}" - method: PUT - body_format: json - body: "{{ item.value }}" - with_dict: "{{ challenge_data.challenge_data_dns }}" - when: "challenge_data is changed and challenge == 'dns-01'" -- name: ({{ certgen_title }}) Create TLS ALPN challenges (acm_challenge_cert_helper) - acme_challenge_cert_helper: - challenge: tls-alpn-01 - challenge_data: "{{ item.value['tls-alpn-01'] }}" - private_key_src: "{{ output_dir }}/{{ certificate_name }}.key" - with_dict: "{{ challenge_data.challenge_data }}" - register: tls_alpn_challenges - when: "challenge_data is changed and challenge == 'tls-alpn-01' and (challenge_alpn_tls is defined and challenge_alpn_tls == 'acme_challenge_cert_helper')" -- name: ({{ certgen_title }}) Set TLS ALPN challenges (acm_challenge_cert_helper) - uri: - url: "http://{{ acme_host }}:5000/tls-alpn/{{ item.domain }}/{{ item.identifier }}/certificate-and-key" - method: PUT - body_format: raw - body: "{{ item.challenge_certificate }}\n{{ lookup('file', output_dir ~ '/' ~ certificate_name ~ '.key') }}" - headers: - content-type: "application/pem-certificate-chain" - with_items: "{{ tls_alpn_challenges.results }}" - when: "challenge_data is changed and challenge == 'tls-alpn-01' and (challenge_alpn_tls is defined and challenge_alpn_tls == 'acme_challenge_cert_helper')" -- name: ({{ certgen_title }}) Create TLS ALPN challenges (der-value-b64) - uri: - url: "http://{{ acme_host }}:5000/tls-alpn/{{ item.value['tls-alpn-01'].resource }}/{{ item.value['tls-alpn-01'].resource_original }}/der-value-b64" - method: PUT - body_format: raw - body: "{{ item.value['tls-alpn-01'].resource_value }}" - headers: - content-type: "application/octet-stream" - with_dict: "{{ challenge_data.challenge_data }}" - when: "challenge_data is changed and challenge == 'tls-alpn-01' and (challenge_alpn_tls is not defined or challenge_alpn_tls == 'der-value-b64')" -## ACME STEP 2 ################################################################################ -- name: ({{ certgen_title }}) Obtain cert, step 2 - acme_certificate: - select_crypto_backend: "{{ select_crypto_backend }}" - acme_version: 2 - acme_directory: https://{{ acme_host }}:14000/dir - validate_certs: no - account_key: "{{ (output_dir ~ '/' ~ account_key ~ '.pem') if account_key_content is not defined else omit }}" - account_key_content: "{{ account_key_content | default(omit) }}" - account_uri: "{{ challenge_data.account_uri }}" - modify_account: "{{ modify_account }}" - csr: "{{ output_dir }}/{{ certificate_name }}.csr" - dest: "{{ output_dir }}/{{ certificate_name }}.pem" - fullchain_dest: "{{ output_dir }}/{{ certificate_name }}-fullchain.pem" - chain_dest: "{{ output_dir }}/{{ certificate_name }}-chain.pem" - challenge: "{{ challenge }}" - deactivate_authzs: "{{ deactivate_authzs }}" - force: "{{ force }}" - remaining_days: "{{ remaining_days }}" - terms_agreed: "{{ terms_agreed }}" - account_email: "{{ account_email }}" - data: "{{ challenge_data }}" - retrieve_all_alternates: "{{ retrieve_all_alternates | default(omit) }}" - select_chain: "{{ select_chain | default(omit) if select_crypto_backend == 'cryptography' else omit }}" - register: certificate_obtain_result - when: challenge_data is changed -- name: ({{ certgen_title }}) Deleting HTTP challenges - uri: - url: "http://{{ acme_host }}:5000/http/{{ item.key }}/{{ item.value['http-01'].resource[('.well-known/acme-challenge/'|length):] }}" - method: DELETE - with_dict: "{{ challenge_data.challenge_data }}" - when: "challenge_data is changed and challenge == 'http-01'" -- name: ({{ certgen_title }}) Deleting DNS challenges - uri: - url: "http://{{ acme_host }}:5000/dns/{{ item.key }}" - method: DELETE - with_dict: "{{ challenge_data.challenge_data_dns }}" - when: "challenge_data is changed and challenge == 'dns-01'" -- name: ({{ certgen_title }}) Deleting TLS ALPN challenges - uri: - url: "http://{{ acme_host }}:5000/tls-alpn/{{ item.value['tls-alpn-01'].resource }}" - method: DELETE - with_dict: "{{ challenge_data.challenge_data }}" - when: "challenge_data is changed and challenge == 'tls-alpn-01'" -- name: ({{ certgen_title }}) Get root certificate - get_url: - url: "http://{{ acme_host }}:5000/root-certificate-for-ca/{{ acme_expected_root_number | default(0) if select_crypto_backend == 'cryptography' else 0 }}" - dest: "{{ output_dir }}/{{ certificate_name }}-root.pem" -############################################################################################### diff --git a/test/integration/targets/setup_azure/aliases b/test/integration/targets/setup_azure/aliases deleted file mode 100644 index e69de29bb2..0000000000 --- a/test/integration/targets/setup_azure/aliases +++ /dev/null diff --git a/test/integration/targets/setup_docker/aliases b/test/integration/targets/setup_docker/aliases deleted file mode 100644 index 65e831523c..0000000000 --- a/test/integration/targets/setup_docker/aliases +++ /dev/null @@ -1 +0,0 @@ -needs/target/setup_epel diff --git a/test/integration/targets/setup_docker/defaults/main.yml b/test/integration/targets/setup_docker/defaults/main.yml deleted file mode 100644 index f7be73dc0e..0000000000 --- a/test/integration/targets/setup_docker/defaults/main.yml +++ /dev/null @@ -1,16 +0,0 @@ -docker_cli_version: '0.0' -docker_api_version: '0.0' -docker_py_version: '0.0' -docker_skip_cleanup: no -docker_prereq_packages: [] -docker_packages: - - docker-ce - -docker_pip_extra_packages: [] -docker_pip_packages: - - docker - -docker_cleanup_packages: - - docker - - docker-ce - - docker-ce-cli diff --git a/test/integration/targets/setup_docker/handlers/main.yml b/test/integration/targets/setup_docker/handlers/main.yml deleted file mode 100644 index 93d9657cbb..0000000000 --- a/test/integration/targets/setup_docker/handlers/main.yml +++ /dev/null @@ -1,14 +0,0 @@ -- name: remove pip packages - pip: - state: present - name: "{{ docker_pip_packages | union(docker_pip_extra_packages) }}" - listen: cleanup docker - when: not docker_skip_cleanup | bool - -- name: remove docker pagkages - action: "{{ ansible_facts.pkg_mgr }}" - args: - name: "{{ docker_cleanup_packages }}" - state: absent - listen: cleanup docker - when: not docker_skip_cleanup | bool diff --git a/test/integration/targets/setup_docker/meta/main.yml b/test/integration/targets/setup_docker/meta/main.yml deleted file mode 100644 index 91a63627f6..0000000000 --- a/test/integration/targets/setup_docker/meta/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - setup_remote_constraints diff --git a/test/integration/targets/setup_docker/tasks/Debian.yml b/test/integration/targets/setup_docker/tasks/Debian.yml deleted file mode 100644 index 0ea2cb4be2..0000000000 --- a/test/integration/targets/setup_docker/tasks/Debian.yml +++ /dev/null @@ -1,43 +0,0 @@ -- name: Get OS version - shell: uname -r - register: os_version - -- name: Install pre-reqs - apt: - name: "{{ docker_prereq_packages }}" - state: present - update_cache: yes - notify: cleanup docker - -- name: Add gpg key - shell: curl -fsSL https://download.docker.com/linux/ubuntu/gpg >key && apt-key add key - -- name: Add Docker repo - shell: add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" - -- block: - - name: Prevent service restart - copy: - content: exit 101 - dest: /usr/sbin/policy-rc.d - backup: yes - mode: 0755 - register: policy_rc_d - - - name: Install Docker CE - apt: - name: "{{ docker_packages }}" - state: present - update_cache: yes - always: - - name: Restore /usr/sbin/policy-rc.d (if needed) - command: mv {{ policy_rc_d.backup_file }} /usr/sbin/policy-rc.d - when: - - "'backup_file' in policy_rc_d" - - - name: Remove /usr/sbin/policy-rc.d (if needed) - file: - path: /usr/sbin/policy-rc.d - state: absent - when: - - "'backup_file' not in policy_rc_d" diff --git a/test/integration/targets/setup_docker/tasks/Fedora.yml b/test/integration/targets/setup_docker/tasks/Fedora.yml deleted file mode 100644 index 9f52e8f144..0000000000 --- a/test/integration/targets/setup_docker/tasks/Fedora.yml +++ /dev/null @@ -1,21 +0,0 @@ -- name: Add repository - yum_repository: - file: docker-ce - name: docker-ce-stable - description: Docker CE Stable - $basearch - baseurl: https://download.docker.com/linux/fedora/$releasever/$basearch/stable - enabled: yes - gpgcheck: yes - gpgkey: https://download.docker.com/linux/fedora/gpg - -- name: Update cache - command: dnf makecache - args: - warn: no - -- name: Install docker - dnf: - name: "{{ docker_packages }}" - state: present - enablerepo: docker-ce-test - notify: cleanup docker diff --git a/test/integration/targets/setup_docker/tasks/RedHat-7.yml b/test/integration/targets/setup_docker/tasks/RedHat-7.yml deleted file mode 100644 index cacc708dc8..0000000000 --- a/test/integration/targets/setup_docker/tasks/RedHat-7.yml +++ /dev/null @@ -1,39 +0,0 @@ -# The RHEL extras repository must be enabled to provide the container-selinux package. -# See: https://docs.docker.com/engine/installation/linux/docker-ee/rhel/#install-using-the-repository - -- name: Install Docker pre-reqs - yum: - name: "{{ docker_prereq_packages }}" - state: present - notify: cleanup docker - -- name: Install epel repo which is missing on rhel-7 and is needed for pigz (needed for docker-ce 18) - include_role: - name: setup_epel - -- name: Enable extras repository for RHEL on AWS - command: yum-config-manager --enable rhui-REGION-rhel-server-extras - args: - warn: no - -- name: Add repository - command: yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo - args: - warn: no - -- name: Update cache - command: yum -y makecache fast - args: - warn: no - -- name: Install docker - yum: - name: "{{ docker_packages }}" - state: present - notify: cleanup docker - -- name: Make sure the docker daemon is running (failure expected inside docker container) - service: - name: docker - state: started - ignore_errors: "{{ ansible_virtualization_type == 'docker' }}" diff --git a/test/integration/targets/setup_docker/tasks/RedHat-8.yml b/test/integration/targets/setup_docker/tasks/RedHat-8.yml deleted file mode 100644 index 63bf2a42af..0000000000 --- a/test/integration/targets/setup_docker/tasks/RedHat-8.yml +++ /dev/null @@ -1,29 +0,0 @@ -# The RHEL extras repository must be enabled to provide the container-selinux package. -# See: https://docs.docker.com/engine/installation/linux/docker-ee/rhel/#install-using-the-repository - -- name: Install Docker pre-reqs - dnf: - name: "{{ docker_prereq_packages }}" - state: present - notify: cleanup docker - register: result - until: result is success - retries: 10 - delay: 2 - -- name: Set-up repository - command: dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo - args: - warn: no - -- name: Install docker - dnf: - name: "{{ docker_packages }}" - state: present - notify: cleanup docker - -- name: Make sure the docker daemon is running (failure expected inside docker container) - service: - name: docker - state: started - ignore_errors: "{{ ansible_virtualization_type == 'docker' }}" diff --git a/test/integration/targets/setup_docker/tasks/Suse.yml b/test/integration/targets/setup_docker/tasks/Suse.yml deleted file mode 100644 index 8183194149..0000000000 --- a/test/integration/targets/setup_docker/tasks/Suse.yml +++ /dev/null @@ -1,7 +0,0 @@ -- name: Install docker 17 - zypper: - name: "{{ docker_packages }}" - force: yes - disable_gpg_check: yes - update_cache: yes - notify: cleanup docker diff --git a/test/integration/targets/setup_docker/tasks/main.yml b/test/integration/targets/setup_docker/tasks/main.yml deleted file mode 100644 index 359a6d4493..0000000000 --- a/test/integration/targets/setup_docker/tasks/main.yml +++ /dev/null @@ -1,113 +0,0 @@ -- name: Setup Docker - when: ansible_facts.distribution ~ ansible_facts.distribution_major_version not in ['CentOS6', 'RedHat6'] - block: - - name: Include distribution specific variables - include_vars: "{{ lookup('first_found', params) }}" - vars: - params: - files: - - "{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_major_version }}.yml" - - "{{ ansible_facts.os_family }}-{{ ansible_facts.distribution_major_version }}.yml" - - "{{ ansible_facts.distribution }}.yml" - - "{{ ansible_facts.os_family }}.yml" - - default.yml - paths: - - "{{ role_path }}/vars" - - - name: Include distribution specific tasks - include_tasks: "{{ lookup('first_found', params) }}" - vars: - params: - files: - - "{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_major_version }}.yml" - - "{{ ansible_facts.os_family }}-{{ ansible_facts.distribution_major_version }}.yml" - - "{{ ansible_facts.distribution }}.yml" - - "{{ ansible_facts.os_family }}.yml" - paths: - - "{{ role_path }}/tasks" - - - name: Install Python requirements - pip: - state: present - name: "{{ docker_pip_packages | union(docker_pip_extra_packages) }}" - extra_args: "-c {{ remote_constraints }}" - notify: cleanup docker - - # Detect docker CLI, API and docker-py versions - - name: Check Docker CLI version - command: "docker version -f {% raw %}'{{.Client.Version}}'{% endraw %}" - register: docker_cli_version_stdout - ignore_errors: yes - - - name: Check Docker API version - command: "{{ ansible_python.executable }} -c 'import docker; print(docker.from_env().version()[\"ApiVersion\"])'" - register: docker_api_version_stdout - ignore_errors: yes - - - name: Check docker-py API version - command: "{{ ansible_python.executable }} -c 'import docker; print(docker.__version__)'" - register: docker_py_version_stdout - ignore_errors: yes - - - set_fact: - docker_cli_version: "{{ docker_cli_version_stdout.stdout | default('0.0') }}" - docker_api_version: "{{ docker_api_version_stdout.stdout | default('0.0') }}" - docker_py_version: "{{ docker_py_version_stdout.stdout | default('0.0') }}" - - - debug: - msg: "Docker CLI version: {{ docker_cli_version }}; Docker API version: {{ docker_api_version }}; docker-py library version: {{ docker_py_version }}" - - - block: - # Cleanup docker daemon - - name: "Remove all ansible-test-* docker containers" - shell: 'docker ps --no-trunc --format {% raw %}"{{.Names}}"{% endraw %} | grep "^ansible-test-" | xargs -r docker rm -f' - register: docker_containers - retries: 3 - delay: 3 - until: docker_containers is success - - - name: "Remove all ansible-test-* docker volumes" - shell: 'docker volume ls --format {% raw %}"{{.Name}}"{% endraw %} | grep "^ansible-test-" | xargs -r docker volume rm -f' - register: docker_volumes - - - name: "Remove all ansible-test-* docker networks" - shell: 'docker network ls --no-trunc --format {% raw %}"{{.Name}}"{% endraw %} | grep "^ansible-test-" | xargs -r docker network rm' - register: docker_networks - - - name: Cleaned docker resources - debug: - var: docker_resources - vars: - docker_resources: - containers: "{{ docker_containers.stdout_lines }}" - volumes: "{{ docker_volumes.stdout_lines }}" - networks: "{{ docker_networks.stdout_lines }}" - - # List all existing docker resources - - name: List all docker containers - command: docker ps --no-trunc -a - register: docker_containers - - - name: List all docker volumes - command: docker volume ls - register: docker_volumes - - - name: List all docker networks - command: docker network ls --no-trunc - register: docker_networks - - - name: List all docker images - command: docker images --no-trunc -a - register: docker_images - - - name: Still existing docker resources - debug: - var: docker_resources - vars: - docker_resources: - containers: "{{ docker_containers.stdout_lines }}" - volumes: "{{ docker_volumes.stdout_lines }}" - networks: "{{ docker_networks.stdout_lines }}" - images: "{{ docker_images.stdout_lines }}" - - when: docker_cli_version is version('0.0', '>') diff --git a/test/integration/targets/setup_docker/vars/Debian.yml b/test/integration/targets/setup_docker/vars/Debian.yml deleted file mode 100644 index e9ffb94159..0000000000 --- a/test/integration/targets/setup_docker/vars/Debian.yml +++ /dev/null @@ -1,5 +0,0 @@ -docker_prereq_packages: - - apt-transport-https - - ca-certificates - - curl - - software-properties-common diff --git a/test/integration/targets/setup_docker/vars/Fedora.yml b/test/integration/targets/setup_docker/vars/Fedora.yml deleted file mode 100644 index 4312688103..0000000000 --- a/test/integration/targets/setup_docker/vars/Fedora.yml +++ /dev/null @@ -1,4 +0,0 @@ -docker_prereq_packages: [] - -docker_packages: - - docker-ce diff --git a/test/integration/targets/setup_docker/vars/RedHat-7.yml b/test/integration/targets/setup_docker/vars/RedHat-7.yml deleted file mode 100644 index 7166b1f573..0000000000 --- a/test/integration/targets/setup_docker/vars/RedHat-7.yml +++ /dev/null @@ -1,8 +0,0 @@ -docker_prereq_packages: - - yum-utils - - device-mapper-persistent-data - - lvm2 - - libseccomp - -docker_pip_extra_packages: - - requests==2.6.0 diff --git a/test/integration/targets/setup_docker/vars/RedHat-8.yml b/test/integration/targets/setup_docker/vars/RedHat-8.yml deleted file mode 100644 index 3e15293354..0000000000 --- a/test/integration/targets/setup_docker/vars/RedHat-8.yml +++ /dev/null @@ -1,9 +0,0 @@ -docker_prereq_packages: - - yum-utils - - device-mapper-persistent-data - - lvm2 - - libseccomp - -# Docker CE > 3:18.09.1 requires containerd.io >= 1.2.2-3 which is unavaible at this time -docker_packages: - - docker-ce-3:18.09.1 diff --git a/test/integration/targets/setup_docker/vars/Suse.yml b/test/integration/targets/setup_docker/vars/Suse.yml deleted file mode 100644 index ad0d515e2b..0000000000 --- a/test/integration/targets/setup_docker/vars/Suse.yml +++ /dev/null @@ -1,2 +0,0 @@ -docker_packages: - - docker>=17 diff --git a/test/integration/targets/setup_docker/vars/Ubuntu-14.yml b/test/integration/targets/setup_docker/vars/Ubuntu-14.yml deleted file mode 100644 index 36ab54b9d9..0000000000 --- a/test/integration/targets/setup_docker/vars/Ubuntu-14.yml +++ /dev/null @@ -1,5 +0,0 @@ -docker_pip_extra_packages: - # Installing requests >=2.12.0 on Ubuntu 14.04 breaks certificate validation. We restrict to an older version - # to ensure out get_url tests work out fine. This is only an issue if pyOpenSSL is also installed. - # Not sure why RHEL7 needs this specific version - - requests==2.6.0 diff --git a/test/integration/targets/setup_docker/vars/default.yml b/test/integration/targets/setup_docker/vars/default.yml deleted file mode 100644 index e69de29bb2..0000000000 --- a/test/integration/targets/setup_docker/vars/default.yml +++ /dev/null diff --git a/test/integration/targets/setup_docker_registry/aliases b/test/integration/targets/setup_docker_registry/aliases deleted file mode 100644 index 688c8884b2..0000000000 --- a/test/integration/targets/setup_docker_registry/aliases +++ /dev/null @@ -1,2 +0,0 @@ -needs/target/setup_docker -needs/target/setup_openssl diff --git a/test/integration/targets/setup_docker_registry/files/nginx.conf b/test/integration/targets/setup_docker_registry/files/nginx.conf deleted file mode 100644 index bfba52041a..0000000000 --- a/test/integration/targets/setup_docker_registry/files/nginx.conf +++ /dev/null @@ -1,46 +0,0 @@ -events { - worker_connections 16; -} - -http { - include /etc/nginx/mime.types; - default_type application/octet-stream; - - error_log /dev/stdout info; - access_log /dev/stdout; - - server { - listen *:5000 ssl; - server_name test-registry.ansible.com; - server_name_in_redirect on; - - ssl_protocols TLSv1.2; - ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-DSS-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256'; - ssl_ecdh_curve X25519:secp521r1:secp384r1; - ssl_prefer_server_ciphers on; - ssl_certificate /etc/nginx/cert.pem; - ssl_certificate_key /etc/nginx/cert.key; - - location / { - return 401; - } - - location /v2/ { - proxy_pass http://real-registry:5000; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $http_host; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-For $remote_addr; - proxy_set_header X-Forwarded-Port $server_port; - proxy_set_header X-Request-Start $msec; - - client_max_body_size 0; - chunked_transfer_encoding on; - - auth_basic "Ansible Test Docker Registry"; - auth_basic_user_file /etc/nginx/nginx.htpasswd; - } - } -} diff --git a/test/integration/targets/setup_docker_registry/files/nginx.htpasswd b/test/integration/targets/setup_docker_registry/files/nginx.htpasswd deleted file mode 100644 index 1291ae77ab..0000000000 --- a/test/integration/targets/setup_docker_registry/files/nginx.htpasswd +++ /dev/null @@ -1 +0,0 @@ -testuser:{PLAIN}hunter2 diff --git a/test/integration/targets/setup_docker_registry/handlers/cleanup.yml b/test/integration/targets/setup_docker_registry/handlers/cleanup.yml deleted file mode 100644 index b789174700..0000000000 --- a/test/integration/targets/setup_docker_registry/handlers/cleanup.yml +++ /dev/null @@ -1,31 +0,0 @@ -- name: "Make sure all images are removed" - docker_image: - name: "{{ item }}" - state: absent - with_items: "{{ inames }}" -- name: "Get registry logs" - command: "docker logs {{ registry_name }}" - register: registry_logs - no_log: yes -- name: "Printing registry logs" - debug: var=registry_logs.stdout_lines -- name: "Get nginx logs" - command: "docker logs {{ nginx_name }}" - register: nginx_logs - no_log: yes -- name: "Printing nginx logs" - debug: var=nginx_logs.stdout_lines -- name: "Make sure all containers are removed" - docker_container: - name: "{{ item }}" - state: absent - force_kill: yes - with_items: "{{ cnames }}" - register: result - retries: 3 - delay: 3 - until: result is success -- name: "Make sure all volumes are removed" - command: "docker rm -f {{ item }}" - with_items: "{{ vnames }}" - ignore_errors: yes diff --git a/test/integration/targets/setup_docker_registry/handlers/main.yml b/test/integration/targets/setup_docker_registry/handlers/main.yml deleted file mode 100644 index b2b858a624..0000000000 --- a/test/integration/targets/setup_docker_registry/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -- name: Remove test registry - include_tasks: ../handlers/cleanup.yml diff --git a/test/integration/targets/setup_docker_registry/tasks/main.yml b/test/integration/targets/setup_docker_registry/tasks/main.yml deleted file mode 100644 index fd935f0ee5..0000000000 --- a/test/integration/targets/setup_docker_registry/tasks/main.yml +++ /dev/null @@ -1,3 +0,0 @@ -- when: ansible_facts.distribution ~ ansible_facts.distribution_major_version not in ['CentOS6', 'RedHat6'] - include_tasks: - file: setup.yml diff --git a/test/integration/targets/setup_docker_registry/tasks/setup.yml b/test/integration/targets/setup_docker_registry/tasks/setup.yml deleted file mode 100644 index 416a0303c4..0000000000 --- a/test/integration/targets/setup_docker_registry/tasks/setup.yml +++ /dev/null @@ -1,120 +0,0 @@ ---- -- name: Setup OpenSSL - include_role: - name: setup_openssl - -- name: Register registry cleanup - command: 'true' - # this must be registered before setup_docker is included - # otherwise setup_docker's own cleanup handler will run before registry cleanup, which will cause registry cleanup to fail - notify: Remove test registry - -- name: Setup Docker - include_role: - name: setup_docker - -- name: Create random name prefix and test registry name - set_fact: - name_prefix: "{{ 'ansible-test-%0x' % ((2**32) | random) }}" - registry_name: "{{ 'ansible-test-registry-%0x' % ((2**32) | random) }}" - nginx_name: "{{ 'ansible-test-registry-frontend-%0x' % ((2**32) | random) }}" -- name: Create image and container list - set_fact: - inames: [] - cnames: - - "{{ registry_name }}" - - "{{ nginx_name }}" - vnames: - - "{{ nginx_name }}" - -- debug: - msg: "Using name prefix {{ name_prefix }} and test registry name {{ registry_name }}" - -- block: - - name: Start test registry - docker_container: - name: "{{ registry_name }}" - image: registry:2.6.1 - ports: 5000 - register: registry_container - - - name: Get registry URL - set_fact: - registry_address: "localhost:{{ registry_container.container.NetworkSettings.Ports['5000/tcp'].0.HostPort }}" - - - name: Start nginx frontend for registry - docker_volume: - name: "{{ nginx_name }}" - state: present - - - name: Create container for nginx frontend for registry - docker_container: - state: stopped - name: "{{ nginx_name }}" - image: nginx:alpine - ports: 5000 - links: - - "{{ registry_name }}:real-registry" - volumes: - - "{{ nginx_name }}:/etc/nginx/" - register: nginx_container - - - name: Copy static files into volume - command: docker cp {{ role_path }}/files/{{ item }} {{ nginx_name }}:/etc/nginx/{{ item }} - loop: - - "nginx.conf" - - "nginx.htpasswd" - - - name: Create private key for frontend certificate - openssl_privatekey: - path: "{{ output_dir }}/cert.key" - type: ECC - curve: secp256r1 - - name: Create CSR for frontend certificate - openssl_csr: - path: "{{ output_dir }}/cert.csr" - privatekey_path: "{{ output_dir }}/cert.key" - subject_alt_name: - - "DNS:test-registry.ansible.com" - - name: Create frontend certificate - openssl_certificate: - path: "{{ output_dir }}/cert.pem" - csr_path: "{{ output_dir }}/cert.csr" - privatekey_path: "{{ output_dir }}/cert.key" - provider: selfsigned - - - name: Copy dynamic files into volume - command: docker cp {{ output_dir }}/{{ item }} {{ nginx_name }}:/etc/nginx/{{ item }} - loop: - - "cert.pem" - - "cert.key" - - - name: Start nginx frontend for registry - docker_container: - name: "{{ nginx_name }}" - state: started - register: nginx_container - - - debug: var=nginx_container.container.NetworkSettings - - - name: Wait for registry frontend - uri: - url: "https://{{ nginx_container.container.NetworkSettings.IPAddress }}:5000/v2/" - url_username: testuser - url_password: hunter2 - validate_certs: no - register: result - until: result is success - retries: 5 - delay: 1 - - - name: Get registry URL - set_fact: - registry_frontend_address: "localhost:{{ nginx_container.container.NetworkSettings.Ports['5000/tcp'].0.HostPort }}" - - - debug: msg="Registry available under {{ registry_address }}, NGINX frontend available under {{ registry_frontend_address }}" - - when: docker_py_version is version('1.8.0', '>=') and docker_api_version is version('1.20', '>=') - -- fail: msg="Too old docker / docker-py version to run docker_image tests!" - when: not(docker_py_version is version('1.8.0', '>=') and docker_api_version is version('1.20', '>=')) and (ansible_distribution != 'CentOS' or ansible_distribution_major_version|int > 6) diff --git a/test/integration/targets/setup_ec2/defaults/main.yml b/test/integration/targets/setup_ec2/defaults/main.yml deleted file mode 100644 index fb1f88b1ec..0000000000 --- a/test/integration/targets/setup_ec2/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -resource_prefix: 'ansible-testing-' diff --git a/test/integration/targets/setup_ec2/tasks/common.yml b/test/integration/targets/setup_ec2/tasks/common.yml deleted file mode 100644 index bf23f539a9..0000000000 --- a/test/integration/targets/setup_ec2/tasks/common.yml +++ /dev/null @@ -1,119 +0,0 @@ ---- - -# ============================================================ -- name: test with no parameters - action: "{{module_name}}" - register: result - ignore_errors: true - -- name: assert failure when called with no parameters - assert: - that: - - 'result.failed' - - 'result.msg == "missing required arguments: name"' - -# ============================================================ -- name: test with only name - action: "{{module_name}} name={{ec2_key_name}}" - register: result - ignore_errors: true - -- name: assert failure when called with only 'name' - assert: - that: - - 'result.failed' - - 'result.msg == "Either region or ec2_url must be specified"' - -# ============================================================ -- name: test invalid region parameter - action: "{{module_name}} name='{{ec2_key_name}}' region='asdf querty 1234'" - register: result - ignore_errors: true - -- name: assert invalid region parameter - assert: - that: - - 'result.failed' - - 'result.msg.startswith("value of region must be one of:")' - -# ============================================================ -- name: test valid region parameter - action: "{{module_name}} name='{{ec2_key_name}}' region='{{ec2_region}}'" - register: result - ignore_errors: true - -- name: assert valid region parameter - assert: - that: - - 'result.failed' - - 'result.msg.startswith("No handler was ready to authenticate.")' - -# ============================================================ -- name: test environment variable EC2_REGION - action: "{{module_name}} name='{{ec2_key_name}}'" - environment: - EC2_REGION: '{{ec2_region}}' - register: result - ignore_errors: true - -- name: assert environment variable EC2_REGION - assert: - that: - - 'result.failed' - - 'result.msg.startswith("No handler was ready to authenticate.")' - -# ============================================================ -- name: test invalid ec2_url parameter - action: "{{module_name}} name='{{ec2_key_name}}'" - environment: - EC2_URL: bogus.example.com - register: result - ignore_errors: true - -- name: assert invalid ec2_url parameter - assert: - that: - - 'result.failed' - - 'result.msg.startswith("No handler was ready to authenticate.")' - -# ============================================================ -- name: test valid ec2_url parameter - action: "{{module_name}} name='{{ec2_key_name}}'" - environment: - EC2_URL: '{{ec2_url}}' - register: result - ignore_errors: true - -- name: assert valid ec2_url parameter - assert: - that: - - 'result.failed' - - 'result.msg.startswith("No handler was ready to authenticate.")' - -# ============================================================ -- name: test credentials from environment - action: "{{module_name}} name='{{ec2_key_name}}'" - environment: - EC2_REGION: '{{ec2_region}}' - EC2_ACCESS_KEY: bogus_access_key - EC2_SECRET_KEY: bogus_secret_key - register: result - ignore_errors: true - -- name: assert ec2_key with valid ec2_url - assert: - that: - - 'result.failed' - - '"EC2ResponseError: 401 Unauthorized" in result.msg' - -# ============================================================ -- name: test credential parameters - action: "{{module_name}} name='{{ec2_key_name}}' ec2_region='{{ec2_region}}' ec2_access_key=bogus_access_key ec2_secret_key=bogus_secret_key" - register: result - ignore_errors: true - -- name: assert credential parameters - assert: - that: - - 'result.failed' - - '"EC2ResponseError: 401 Unauthorized" in result.msg' diff --git a/test/integration/targets/setup_ec2/vars/main.yml b/test/integration/targets/setup_ec2/vars/main.yml deleted file mode 100644 index 3d7209ef1b..0000000000 --- a/test/integration/targets/setup_ec2/vars/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -ec2_url: ec2.amazonaws.com -ec2_region: us-east-1 diff --git a/test/integration/targets/setup_flatpak_remote/README.md b/test/integration/targets/setup_flatpak_remote/README.md deleted file mode 100644 index d7916c14b3..0000000000 --- a/test/integration/targets/setup_flatpak_remote/README.md +++ /dev/null @@ -1,138 +0,0 @@ -# Create a dummy flatpak repository remote - -This document describes how to create a local flatpak dummy repo. Just like the one contained in the `files/repo.tar.gxz` archive. - - -## Create a hello world app - -Prerequisites: - - - flathub - -Prepare the environment: - -``` -flatpak install --system flathub org.freedesktop.Platform//1.6 org.freedesktop.Sdk//1.6 -``` - -Create a hello world executable: - -``` -echo $'#!/bin/sh\necho hello world' > hello.sh -``` - -To create dummy flatpaks, run this (defining a unique NUM for every flatpak to add): - -``` -export NUM=1 -flatpak build-init appdir$NUM com.dummy.App$NUM org.freedesktop.Sdk org.freedesktop.Platform 1.6; -flatpak build appdir$NUM mkdir /app/bin; -flatpak build appdir$NUM install --mode=750 hello.sh /app/bin; -flatpak build-finish --command=hello.sh appdir$NUM -``` - -## Create a repo and/or add the app to it - -Create a repo and add the file to it in one command: - -``` -flatpak build-export repo appdir$NUM stable -``` - -## Create flatpak*-files - -Put a flatpakref file under the repo folder (`repo/com.dummy.App1.flatpakref`): - -``` -[Flatpak Ref] -Title=Dummy App$NUM -Name=com.dummy.App$NUM -Branch=stable -Url=file:///tmp/flatpak/repo -GPGKey={{ base64-encoded public KEY }} -IsRuntime=false -RuntimeRepo=https://flathub.org/repo/flathub.flatpakrepo -``` - -Add a `.flatpakrepo` file to the `repo` folder (`repo/dummy-repo.flatpakrepo`): - -``` -[Flatpak Repo] -Title=Dummy Repo -Url=file:///tmp/flatpak/repo -Comment=Dummy repo for ansible module integration testing -Description=Dummy repo for ansible module integration testing -GPGKey={{ base64-encoded public KEY }} -``` - -## Sign the repo - -Create a new key in a new gpg home folder (On RedHat systems, the executable needs to addressed as gpg2): - -``` -mkdir gpg -gpg --homedir gpg --quick-gen-key test@dummy.com -``` - -Sign the repo and summary file, you need to redo this when you update the repository: - -``` -flatpak build-sign repo --gpg-sign=KEY_ID --gpg-homedir=gpg -flatpak build-update-repo repo --gpg-sign=KEY_ID --gpg-homedir=gpg -``` - -Export the public key as a file: - -``` -gpg --homedir=gpg --export KEY_ID > dummy-repo.gpg -``` - -Create base64-encoded string from gpg-file for `GPGKey=` property in flatpak*-files: - -``` -base64 dummy-repo.gpg | tr -d '\n' -``` - -## How to use the repo - -Now you can add the `repo` folder as a local repo: - -``` -flatpak --system remote-add --gpg-import=/tmp/flatpak/repo/dummy-repo.gpg dummy-repo /tmp/flatpak/repo -``` - -Or, via `.flatpakrepo` file: - -``` -flatpak --system remote-add dummy-repo /tmp/flatpak/repo/dummy-repo.flatpakrepo -``` - -And install the hello world flatpaks like this: - -``` -flatpak --system install dummy-repo com.dummy.App$NUM -``` - -Or from flatpakref: - -``` -flatpak --system install --from /tmp/flatpak/repo/com.dummy.App$NUM.flatpakref -``` - -Run the app: - -``` -flatpak run com.dummy.App$NUM -``` - -To install an app without any runtime dependencies (the app will be broken, but it is enough to test flatpak installation): - -``` -flatpak --system install --no-deps dummy-repo com.dummy.App$NUM -``` - -## Sources: - -* https://blogs.gnome.org/alexl/2017/02/10/maintaining-a-flatpak-repository/ - -* http://docs.flatpak.org/en/latest/first-build.html diff --git a/test/integration/targets/setup_flatpak_remote/files/repo.tar.xz b/test/integration/targets/setup_flatpak_remote/files/repo.tar.xz Binary files differdeleted file mode 100644 index 41a89c46ef..0000000000 --- a/test/integration/targets/setup_flatpak_remote/files/repo.tar.xz +++ /dev/null diff --git a/test/integration/targets/setup_flatpak_remote/handlers/main.yaml b/test/integration/targets/setup_flatpak_remote/handlers/main.yaml deleted file mode 100644 index 9380dee96b..0000000000 --- a/test/integration/targets/setup_flatpak_remote/handlers/main.yaml +++ /dev/null @@ -1,4 +0,0 @@ -- name: remove temporary flatpak link - file: - state: absent - path: /tmp/flatpak diff --git a/test/integration/targets/setup_flatpak_remote/meta/main.yaml b/test/integration/targets/setup_flatpak_remote/meta/main.yaml deleted file mode 100644 index 75ee4583ac..0000000000 --- a/test/integration/targets/setup_flatpak_remote/meta/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - setup_remote_tmp_dir diff --git a/test/integration/targets/setup_flatpak_remote/tasks/main.yaml b/test/integration/targets/setup_flatpak_remote/tasks/main.yaml deleted file mode 100644 index c199d216fa..0000000000 --- a/test/integration/targets/setup_flatpak_remote/tasks/main.yaml +++ /dev/null @@ -1,22 +0,0 @@ -- name: Set up dummy flatpak repository remote - block: - - - name: Copy repo into place - unarchive: - src: repo.tar.xz - dest: "{{ remote_tmp_dir }}" - owner: root - group: root - mode: 0644 - - - name: Create deterministic link to temp directory - file: - state: link - src: "{{ remote_tmp_dir }}/" - path: "/tmp/flatpak" - owner: root - group: root - mode: 0644 - notify: remove temporary flatpak link - - become: true diff --git a/test/integration/targets/setup_grafana/files/grafana.repo b/test/integration/targets/setup_grafana/files/grafana.repo deleted file mode 100644 index f4b6f1f3f1..0000000000 --- a/test/integration/targets/setup_grafana/files/grafana.repo +++ /dev/null @@ -1,9 +0,0 @@ -[grafana] -name=grafana -baseurl=https://packages.grafana.com/oss/rpm -repo_gpgcheck=1 -enabled=1 -gpgcheck=1 -gpgkey=https://packages.grafana.com/gpg.key -sslverify=1 -sslcacert=/etc/pki/tls/certs/ca-bundle.crt diff --git a/test/integration/targets/setup_grafana/tasks/main.yml b/test/integration/targets/setup_grafana/tasks/main.yml deleted file mode 100644 index 9ebe59b624..0000000000 --- a/test/integration/targets/setup_grafana/tasks/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -- include: setup.yml - when: ansible_distribution == 'Ubuntu' and ansible_distribution_release != 'trusty' diff --git a/test/integration/targets/setup_grafana/tasks/setup.yml b/test/integration/targets/setup_grafana/tasks/setup.yml deleted file mode 100644 index 34e780bd23..0000000000 --- a/test/integration/targets/setup_grafana/tasks/setup.yml +++ /dev/null @@ -1,30 +0,0 @@ -- name: Install deps - package: - name: - - apt-transport-https - - software-properties-common - -- name: Add the Grafana GPG key - apt_key: - url: https://packages.grafana.com/gpg.key - state: present - -- name: Add grafana apt repository - apt_repository: - repo: deb https://packages.grafana.com/oss/deb stable main - state: present - -- name: Install Grafana server - apt: - allow_unauthenticated: yes - name: grafana - -- name: start Grafana - service: - name: grafana-server - state: started - -- name: wait for grafana to be up - wait_for: - host: 127.0.0.1 - port: 3000 diff --git a/test/integration/targets/setup_influxdb/tasks/main.yml b/test/integration/targets/setup_influxdb/tasks/main.yml deleted file mode 100644 index 55fdd27298..0000000000 --- a/test/integration/targets/setup_influxdb/tasks/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- - -- include: setup.yml - when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'trusty' diff --git a/test/integration/targets/setup_influxdb/tasks/setup.yml b/test/integration/targets/setup_influxdb/tasks/setup.yml deleted file mode 100644 index 0069be1562..0000000000 --- a/test/integration/targets/setup_influxdb/tasks/setup.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- - -- name: Install https transport for apt and ca-certificates - apt: name={{ item }} state=latest force=yes - with_items: - - apt-transport-https - - ca-certificates - -- name: Install apt_key dependencies - pip: name={{ item }} - with_items: - - pyOpenSSL - - ndg-httpsclient - - pyasn1 - -- name: Add InfluxDB public GPG key - apt_key: url=https://repos.influxdata.com/influxdb.key state=present - -- name: Add InfluxDB repository - apt_repository: repo='deb https://repos.influxdata.com/ubuntu trusty stable' filename='influxdb' state=present update_cache=yes - -- name: Install InfluxDB - apt: name=influxdb state=latest - -- name: Start InfluxDB service - service: name=influxdb state=started diff --git a/test/integration/targets/setup_mariadb/defaults/main.yml b/test/integration/targets/setup_mariadb/defaults/main.yml deleted file mode 100644 index 04bce1803f..0000000000 --- a/test/integration/targets/setup_mariadb/defaults/main.yml +++ /dev/null @@ -1,37 +0,0 @@ -repo_link: http://yum.mariadb.org/10.1/centos7-amd64 -repo_gpgkey: https://yum.mariadb.org/RPM-GPG-KEY-MariaDB - -mariadb_packages: - - MariaDB-server - - MariaDB-client - -packages_to_cleanup: - - MariaDB-common - - boost-program-options - - galera - - jemalloc - -primary_db: - name: primary - port: 3306 - datadir: /var/lib/mysql_primary - logdir: /var/log/mysql_primary - -replica_db: - name: replica01 - port: 3307 - datadir: /var/lib/mysql_replica01 - logdir: /var/log/mysql_replica01 - -default_datadir: /var/lib/mysql -default_logdir: /var/log/mariadb -mysql_safe_err_log: /var/log/mariadb/mysql_safe-err.log - -fs_objects_to_clean_up: - - "{{ primary_db.datadir }}" - - "{{ primary_db.logdir }}" - - "{{ replica_db.datadir }}" - - "{{ replica_db.logdir }}" - - "{{ default_datadir }}" - - "{{ default_logdir }}" - - "{{ mysql_safe_err_log }}" diff --git a/test/integration/targets/setup_mariadb/handlers/main.yml b/test/integration/targets/setup_mariadb/handlers/main.yml deleted file mode 100644 index 9d84dddf6c..0000000000 --- a/test/integration/targets/setup_mariadb/handlers/main.yml +++ /dev/null @@ -1,27 +0,0 @@ -- name: Stop MariaDB services - service: - name: mariadb@{{ item }} - state: stopped - loop: - - "{{ primary_db.name }}" - - "{{ replica_db.name }}" - listen: cleanup mariadb - -- name: Remove MariaDB repo - yum_repository: - name: MariaDB - state: absent - listen: cleanup mariadb - -- name: Remove MariaDB related packages - yum: - name: "{{ packages_to_cleanup | union(mariadb_packages) }}" - state: absent - listen: cleanup mariadb - -- name: Remove related FS objects - file: - state: absent - path: "{{ item }}" - loop: "{{ fs_objects_to_clean_up }}" - listen: cleanup mariadb diff --git a/test/integration/targets/setup_mariadb/tasks/main.yml b/test/integration/targets/setup_mariadb/tasks/main.yml deleted file mode 100644 index 4be1e45d9f..0000000000 --- a/test/integration/targets/setup_mariadb/tasks/main.yml +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright: (c) 2019, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru> -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - -- import_tasks: setup_mariadb.yml - when: - - ansible_distribution == 'CentOS' - - ansible_distribution_major_version is version('7', '>=') diff --git a/test/integration/targets/setup_mariadb/tasks/setup_mariadb.yml b/test/integration/targets/setup_mariadb/tasks/setup_mariadb.yml deleted file mode 100644 index 7c3a1c3483..0000000000 --- a/test/integration/targets/setup_mariadb/tasks/setup_mariadb.yml +++ /dev/null @@ -1,107 +0,0 @@ -# We run two servers listening different ports -# to be able to check replication (one server for primary, another for replica). - -- name: Include distribution specific variables - include_vars: "{{ lookup('first_found', params) }}" - vars: - params: - files: - - "{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_version }}.yml" - - "{{ ansible_facts.os_family }}-{{ ansible_facts.distribution_major_version }}.yml" - - "{{ ansible_facts.distribution }}.yml" - - "{{ ansible_facts.os_family }}.yml" - - default.yml - paths: - - vars - -- name: Install MariaDB repo - yum_repository: - name: MariaDB - description: MariaDB official repo - baseurl: "{{ repo_link }}" - gpgkey: "{{ repo_gpgkey }}" - gpgcheck: yes - notify: cleanup mariadb - -- name: Install MariaDB packages - yum: - name: "{{ mariadb_packages }}" - enablerepo: "{{ mariadb_enable_repo | default(omit) }}" - notify: cleanup mariadb - -- name: Create directories for instances - file: - state: directory - path: "{{ item }}" - owner: mysql - group: mysql - loop: - - "{{ primary_db.datadir }}" - - "{{ primary_db.logdir }}" - - "{{ replica_db.datadir }}" - - "{{ replica_db.logdir }}" - notify: cleanup mariadb - -- name: Copy configuration templates - template: - src: "{{ 'my' ~ item ~ '.j2' }}" - dest: /etc/my.cnf.d/my{{ item }}.cnf - owner: mysql - group: mysql - force: yes - when: ansible_facts.distribution_major_version is version('7', '==') - loop: - - '{{ primary_db.name }}' - - '{{ replica_db.name }}' - -- name: Copy configuration template - template: - src: my.cnf.j2 - dest: /etc/my.cnf - owner: mysql - group: mysql - force: yes - when: ansible_facts.distribution_major_version is version('8', '==') - -- name: Initialize DBs - shell: 'mysql_install_db --user=mysql --datadir={{ item }}' - loop: - - '{{ primary_db.datadir }}' - - '{{ replica_db.datadir }}' - -- name: Start services - service: - name: mariadb@{{ item }} - state: started - loop: - - "{{ primary_db.name }}" - - "{{ replica_db.name }}" - -- pause: - seconds: 3 - -########### For painful debug uncomment the lines below ## -#- name: DEBUG Check stratup log -# shell: cat /var/log/mariadb/mariadb.log - -#- name: DEBUG Check mysql_safe err log -# shell: cat '{{ mysql_safe_err_log }}' - -#- name: DEBUG Check processes -# shell: 'ps aux | grep mysqld | grep -v "grep\|root"' - -#- name: DEBUG -# yum: name=net-tools - -#- name: DEBUG -# shell: "netstat -ntpl" - -#- name: DEBUG -# shell: cat /etc/my.cnf -########################################################## - -- name: Check connection to the primary - shell: 'echo "SHOW DATABASES;" | mysql -P {{ primary_db.port }} -h 127.0.0.1' - -- name: Check connection to the replica - shell: "echo \"SHOW VARIABLES LIKE 'datadir';\" | mysql -P {{ replica_db.port }} -h 127.0.0.1" diff --git a/test/integration/targets/setup_mariadb/templates/my.cnf.j2 b/test/integration/targets/setup_mariadb/templates/my.cnf.j2 deleted file mode 100644 index 21b5fe7f09..0000000000 --- a/test/integration/targets/setup_mariadb/templates/my.cnf.j2 +++ /dev/null @@ -1,31 +0,0 @@ -[mysqld.{{ primary_db.name }}] -server_id = 1 -port = {{ primary_db.port }} -datadir = {{ primary_db.datadir }} -socket = {{ primary_db.datadir }}/mysql.sock -pid-file = {{ primary_db.datadir }}/mysql.pid -log_bin = {{ primary_db.logdir }}/mysql-bin.log -sync_binlog = 1 -binlog-format = ROW -innodb_flush_log_at_trx_commit = 1 - -[mysqld.{{ replica_db.name }}] -server_id = 2 -port = {{ replica_db.port }} -datadir = {{ replica_db.datadir }} -socket = {{ replica_db.datadir }}/mysqld_replica.sock -pid-file = {{ replica_db.datadir }}/mysqld_replica.pid -log_bin = {{ replica_db.logdir }}/mysql-bin.log -relay-log = {{ replica_db.logdir }}/relay-bin -relay-log-index = {{ replica_db.logdir }}/relay-bin.index -master-info-file = {{ replica_db.logdir }}/master.info -relay-log-info-file = {{ replica_db.logdir }}/relay-log.info - -[mysqld_multi] -mysqld = /usr/bin/mysqld_safe -user = multi_admin -password = multipass - -[mysqld_safe] -log-error={{ mysql_safe_err_log }} -pid-file=/var/run/mariadb/mariadb.pid diff --git a/test/integration/targets/setup_mariadb/templates/myprimary.j2 b/test/integration/targets/setup_mariadb/templates/myprimary.j2 deleted file mode 100644 index 6ff612a880..0000000000 --- a/test/integration/targets/setup_mariadb/templates/myprimary.j2 +++ /dev/null @@ -1,10 +0,0 @@ -[mysqld] -server_id = 1 -port = {{ primary_db.port }} -datadir = {{ primary_db.datadir }} -socket = {{ primary_db.datadir }}/mysql.sock -pid-file = {{ primary_db.datadir }}/mysql.pid -log_bin = {{ primary_db.logdir }}/mysql-bin.log -sync_binlog = 1 -binlog-format = ROW -innodb_flush_log_at_trx_commit = 1 diff --git a/test/integration/targets/setup_mariadb/templates/myreplica01.j2 b/test/integration/targets/setup_mariadb/templates/myreplica01.j2 deleted file mode 100644 index d26ddaef69..0000000000 --- a/test/integration/targets/setup_mariadb/templates/myreplica01.j2 +++ /dev/null @@ -1,11 +0,0 @@ -[mysqld] -server_id = 2 -port = {{ replica_db.port }} -datadir = {{ replica_db.datadir }} -socket = {{ replica_db.datadir }}/mysqld_replica.sock -pid-file = {{ replica_db.datadir }}/mysqld_replica.pid -log_bin = {{ replica_db.logdir }}/mysql-bin.log -relay-log = {{ replica_db.logdir }}/relay-bin -relay-log-index = {{ replica_db.logdir }}/relay-bin.index -master-info-file = {{ replica_db.logdir }}/master.info -relay-log-info-file = {{ replica_db.logdir }}/relay-log.info diff --git a/test/integration/targets/setup_mariadb/vars/RedHat-7.yml b/test/integration/targets/setup_mariadb/vars/RedHat-7.yml deleted file mode 100644 index da73d98b47..0000000000 --- a/test/integration/targets/setup_mariadb/vars/RedHat-7.yml +++ /dev/null @@ -1,4 +0,0 @@ -mariadb_enable_repo: epel -mariadb_packages: - - MariaDB-server - - MySQL-python diff --git a/test/integration/targets/setup_mariadb/vars/RedHat-8.yml b/test/integration/targets/setup_mariadb/vars/RedHat-8.yml deleted file mode 100644 index c68a6b1c68..0000000000 --- a/test/integration/targets/setup_mariadb/vars/RedHat-8.yml +++ /dev/null @@ -1,3 +0,0 @@ -mariadb_packages: - - mariadb-server - - python3-PyMySQL diff --git a/test/integration/targets/setup_mariadb/vars/default.yml b/test/integration/targets/setup_mariadb/vars/default.yml deleted file mode 100644 index e69de29bb2..0000000000 --- a/test/integration/targets/setup_mariadb/vars/default.yml +++ /dev/null diff --git a/test/integration/targets/setup_mongodb/defaults/main.yml b/test/integration/targets/setup_mongodb/defaults/main.yml deleted file mode 100644 index b205013c94..0000000000 --- a/test/integration/targets/setup_mongodb/defaults/main.yml +++ /dev/null @@ -1,46 +0,0 @@ -mongodb_version: "4.0" - -apt: - keyserver: "keyserver.ubuntu.com" - keyserver_id: "9DA31620334BD75D9DCB49F368818C72E52529D4" - repo: "deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu {{ansible_distribution_release}}/mongodb-org/{{mongodb_version}} multiverse" - -mongodb_packages: - mongod: mongodb-org-server - mongos: mongodb-org-mongos - mongo: mongodb-org-shell - -yum: - name: mongodb-org - description: "Official MongoDB {{mongodb_version}} yum repo" - baseurl: https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/{{mongodb_version}}/x86_64/ - gpgcheck: 1 - gpgkey: https://www.mongodb.org/static/pgp/server-{{mongodb_version}}.asc - redhat8url: https://repo.mongodb.org/yum/redhat/7/mongodb-org/{{mongodb_version}}/x86_64/ - fedoraurl: https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/{{mongodb_version}}/x86_64/ - -debian_packages_py2: - - python-dev - - python-setuptools - - python-pip - -debian_packages_py36: - - python3.6-dev - - python3-setuptools - - python3-pip - -redhat_packages_py2: - - python-devel - - python-setuptools - - python-pip - -redhat_packages_py3: - - python3-devel - - python3-setuptools - - python3-pip - -# Do not install requests[security] via pip. It will cause test failures. -# See https://github.com/ansible/ansible/pull/66319 -pip_packages: - - psutil - - pymongo diff --git a/test/integration/targets/setup_mongodb/handlers/main.yml b/test/integration/targets/setup_mongodb/handlers/main.yml deleted file mode 100644 index 1b73525e9c..0000000000 --- a/test/integration/targets/setup_mongodb/handlers/main.yml +++ /dev/null @@ -1,24 +0,0 @@ -- name: Remove debian_packages_py2 - apt: - name: "{{ debian_packages_py2 }}" - state: absent - -- name: Remove debian_packages_py36 - apt: - name: "{{ debian_packages_py36 }}" - state: absent - -- name: Remove redhat_packages_py2 - yum: - name: "{{ redhat_packages_py36 }}" - state: absent - -- name: Remove redhat_packages_py36 - yum: - name: "{{ redhat_packages_py36 }}" - state: absent - -- name: remove mongodb pip packages - pip: - name: "{{ pip_packages }}" - state: absent diff --git a/test/integration/targets/setup_mongodb/tasks/main.yml b/test/integration/targets/setup_mongodb/tasks/main.yml deleted file mode 100644 index 16382ce5d1..0000000000 --- a/test/integration/targets/setup_mongodb/tasks/main.yml +++ /dev/null @@ -1,166 +0,0 @@ -# (c) 2019, Rhys Campbell <rhys.james.campbell@googlemail.com> - -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see <http://www.gnu.org/licenses/>. - -# ============================================================ - -# https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ -# Support for Ubuntu 14.04 has been removed from MongoDB 4.0.10+, 3.6.13+, and 3.4.21+. -# CentOS6 has python version issues -- meta: end_play - when: (ansible_distribution == 'Ubuntu' and ansible_distribution_version == '14.04') - or (ansible_os_family == "RedHat" and ansible_distribution_major_version == '6') - or ansible_os_family == "Suse" - or ansible_distribution == 'Fedora' - or (ansible_facts['distribution'] == "CentOS") - -# Ubuntu -- name: Import MongoDB public GPG Key - apt_key: - keyserver: "{{ apt.keyserver }}" - id: "{{ apt.keyserver_id }}" - when: - - ansible_distribution_version in ["16.04", "18.04"] - - ansible_distribution == 'Ubuntu' - -- name: Add MongoDB repository into sources list - apt_repository: - repo: "{{ apt.repo }}" - state: present - update_cache: yes - when: - - ansible_distribution_version in ["16.04", "18.04"] - - ansible_distribution == 'Ubuntu' - -# Need to handle various platforms here. Package name will not always be the same -- name: Ensure mongod package is installed - apt: - name: "{{ mongodb_packages.mongod }}" - state: present - force: yes - when: - - ansible_distribution == 'Ubuntu' - -- name: Ensure mongos package is installed - apt: - name: "{{ mongodb_packages.mongos }}" - state: present - force: yes - when: - - ansible_distribution == 'Ubuntu' - -- name: Ensure mongo client is installed - apt: - name: "{{ mongodb_packages.mongo }}" - state: present - force: yes - when: - - ansible_distribution == 'Ubuntu' -# EOF Ubuntu - -# Redhat -- name: Add MongopDB repo - yum_repository: - name: "{{ yum.name }}" - description: "{{ yum.description }}" - baseurl: "{{ yum.baseurl }}" - gpgcheck: "{{ yum.gpgcheck }}" - gpgkey: "{{ yum.gpgkey }}" - when: - - ansible_os_family == "RedHat" - - ansible_distribution_version.split('.')[0]|int <= 7 - - not ansible_distribution == "Fedora" - - -- name: RedHat 8 repo not yet available so use 7 url - yum_repository: - name: "{{ yum.name }}" - description: "{{ yum.description }}" - baseurl: "{{ yum.redhat8url }}" - gpgcheck: "{{ yum.gpgcheck }}" - gpgkey: "{{ yum.gpgkey }}" - when: - - ansible_os_family == "RedHat" - - ansible_distribution_version.split('.')[0]|int == 8 - - not ansible_distribution == "Fedora" - -- name: Another url for Fedora based systems - yum_repository: - name: "{{ yum.name }}" - description: "{{ yum.description }}" - baseurl: "{{ yum.fedoraurl }}" - gpgcheck: "{{ yum.gpgcheck }}" - gpgkey: "{{ yum.gpgkey }}" - when: - - ansible_distribution == "Fedora" - -- name: Ensure mongod package is installed - yum: - name: "{{ mongodb_packages.mongod }}" - state: present - when: ansible_os_family == "RedHat" - -- name: Ensure mongos package is installed - yum: - name: "{{ mongodb_packages.mongos }}" - state: present - when: ansible_os_family == "RedHat" - -- name: Ensure mongo client is installed - yum: - name: "{{ mongodb_packages.mongo }}" - state: present - when: ansible_os_family == "RedHat" -# EOF Redhat - -- name: Install debian_packages - apt: - name: "{{ debian_packages_py2 }}" - when: - - ansible_os_family == "Debian" - - ansible_distribution_version == "16.04" - notify: Remove debian_packages_py2 - -- name: Install debian_packages - apt: - name: "{{ debian_packages_py36 }}" - when: - - ansible_os_family == "Debian" - - ansible_distribution_version == "18.04" - notify: Remove debian_packages_py36 - -- name: Install redhat_packages_py2 - yum: - name: "{{ redhat_packages_py2 }}" - when: - - ansible_os_family == "RedHat" - - ansible_distribution_version|float < 8 - - not (ansible_os_family == "RedHat" and ansible_distribution_version|float < 8) - notify: Remove redhat_packages_py2 - -- name: Install redhat_packages_py3 - yum: - name: "{{ redhat_packages_py3 }}" - when: - - ansible_os_family == "RedHat" - - ansible_distribution_version|float >= 8 - notify: Remove redhat_packages_py3 - -- name: Install pip packages - pip: - name: "{{ pip_packages }}" - state: present - notify: remove mongodb pip packages diff --git a/test/integration/targets/setup_mongodb_v4/defaults/main.yml b/test/integration/targets/setup_mongodb_v4/defaults/main.yml deleted file mode 100644 index 89e0c4df56..0000000000 --- a/test/integration/targets/setup_mongodb_v4/defaults/main.yml +++ /dev/null @@ -1,13 +0,0 @@ -mongodb_repo_name: mongodb -mongodb_repo_descr: MongoDB Repository -mongodb_repo_link: http://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.2/$basearch/ -mongodb_gpgkey: https://www.mongodb.org/static/pgp/server-4.2.asc -mongodb_pkgs: -- mongodb-org - -pymongo_repo: git://github.com/mongodb/mongo-python-driver.git - -mongodb_default_port: 27017 -mongodb_admin_user: admin -mongodb_admin_password: admin -mongodb_default_db: admin diff --git a/test/integration/targets/setup_mongodb_v4/handlers/main.yml b/test/integration/targets/setup_mongodb_v4/handlers/main.yml deleted file mode 100644 index f3379859df..0000000000 --- a/test/integration/targets/setup_mongodb_v4/handlers/main.yml +++ /dev/null @@ -1,10 +0,0 @@ -- name: Remove MongoDB packages - yum: - name: '{{ mongodb_pkgs }}' - state: absent - -- name: Stop MongoDB - systemd: - name: mongod.service - state: stopped - notify: Stop MongoDB diff --git a/test/integration/targets/setup_mongodb_v4/tasks/main.yml b/test/integration/targets/setup_mongodb_v4/tasks/main.yml deleted file mode 100644 index 5e0f49cd3f..0000000000 --- a/test/integration/targets/setup_mongodb_v4/tasks/main.yml +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright 2020, Andrew Klychkov <aaklychkov@mail.ru> -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - -- import_tasks: setup_mongodb.yml - when: - - ansible_distribution == 'CentOS' - - ansible_distribution_major_version is version('7', '>=') diff --git a/test/integration/targets/setup_mongodb_v4/tasks/setup_mongodb.yml b/test/integration/targets/setup_mongodb_v4/tasks/setup_mongodb.yml deleted file mode 100644 index e1b2c32795..0000000000 --- a/test/integration/targets/setup_mongodb_v4/tasks/setup_mongodb.yml +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2020, Andrew Klychkov <aaklychkov@mail.ru> -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - -- name: Set up repo - yum_repository: - name: '{{ mongodb_repo_name }}' - description: '{{ mongodb_repo_descr }}' - baseurl: '{{ mongodb_repo_link }}' - gpgkey: '{{ mongodb_gpgkey }}' - gpgcheck: yes - -- name: Install MongoDB packages - yum: - name: '{{ mongodb_pkgs }}' - state: present - notify: Remove MongoDB packages - -- name: Install pymongo - shell: git clone '{{ pymongo_repo }}' pymongo && cd pymongo/ && python setup.py install - -- name: Start MongoDB - systemd: - name: mongod.service - state: started - notify: Stop MongoDB - -- name: Create admin user - mongodb_user: - login_port: '{{ mongodb_default_port }}' - database: '{{ mongodb_default_db }}' - name: '{{ mongodb_admin_user }}' - password: '{{ mongodb_admin_password }}' - roles: root - state: present diff --git a/test/integration/targets/setup_mosquitto/files/mosquitto.conf b/test/integration/targets/setup_mosquitto/files/mosquitto.conf deleted file mode 100644 index 84a80b71c3..0000000000 --- a/test/integration/targets/setup_mosquitto/files/mosquitto.conf +++ /dev/null @@ -1,35 +0,0 @@ -# Plain MQTT protocol -listener 1883 - -# MQTT over TLS 1.1 -listener 8883 -tls_version tlsv1.1 -cafile /tls/ca_certificate.pem -certfile /tls/server_certificate.pem -keyfile /tls/server_key.pem - -# MQTT over TLS 1.2 -listener 8884 -tls_version tlsv1.2 -cafile /tls/ca_certificate.pem -certfile /tls/server_certificate.pem -keyfile /tls/server_key.pem - -# TODO(This does not appear to be supported on Ubuntu 18.04. Re-try on 20.04 or next LTS release) -# MQTT over TLS 1.3 -# -# listener 8885 -# tls_version tlsv1.3 -# cafile /tls/ca_certificate.pem -# certfile /tls/server_certificate.pem -# keyfile /tls/server_key.pem - -log_dest syslog - -log_type error -log_type warning -log_type notice -log_type information -log_type debug - -connection_messages true diff --git a/test/integration/targets/setup_mosquitto/meta/main.yml b/test/integration/targets/setup_mosquitto/meta/main.yml deleted file mode 100644 index af05db79d4..0000000000 --- a/test/integration/targets/setup_mosquitto/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - setup_tls diff --git a/test/integration/targets/setup_mosquitto/tasks/main.yml b/test/integration/targets/setup_mosquitto/tasks/main.yml deleted file mode 100644 index 4f35f16f62..0000000000 --- a/test/integration/targets/setup_mosquitto/tasks/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- include: ubuntu.yml - when: ansible_distribution == 'Ubuntu' diff --git a/test/integration/targets/setup_mosquitto/tasks/ubuntu.yml b/test/integration/targets/setup_mosquitto/tasks/ubuntu.yml deleted file mode 100644 index 5675cb8923..0000000000 --- a/test/integration/targets/setup_mosquitto/tasks/ubuntu.yml +++ /dev/null @@ -1,24 +0,0 @@ -- name: Install https transport for apt - apt: - name: apt-transport-https - state: latest - force: yes - -- name: Install Mosquitto Server - apt: - name: mosquitto - state: latest - register: result - until: result is success - delay: 3 - retries: 10 - -- name: Ensure TLS config - copy: - src: mosquitto.conf - dest: /etc/mosquitto/mosquitto.conf - -- name: Start Mosquitto service - service: - name: mosquitto - state: restarted diff --git a/test/integration/targets/setup_mysql8/defaults/main.yml b/test/integration/targets/setup_mysql8/defaults/main.yml deleted file mode 100644 index 66b75a11eb..0000000000 --- a/test/integration/targets/setup_mysql8/defaults/main.yml +++ /dev/null @@ -1,21 +0,0 @@ -repo_link: https://repo.mysql.com/mysql80-community-release-el{{ ansible_facts.distribution_major_version }}.rpm -my_cnf: /etc/my.cnf - -mysql_data_dirs: - - /var/lib/mysql - - /usr/mysql - -mysql_support_packages: - - MySQL-python - -mysql_server_packages: - - mysql-community-server - -mysql_cleanup_packages: - - mysql-community-client - - mysql-community-common - - mysql-community-libs - - mysql-community-libs-compat - - mysql-community-server - - mysql80-community-release - - python3-PyMySQL diff --git a/test/integration/targets/setup_mysql8/files/my.cnf b/test/integration/targets/setup_mysql8/files/my.cnf deleted file mode 100644 index 7fdc2afc26..0000000000 --- a/test/integration/targets/setup_mysql8/files/my.cnf +++ /dev/null @@ -1,7 +0,0 @@ -[mysqld] -datadir=/var/lib/mysql -socket=/var/lib/mysql/mysql.sock -log-error=/var/log/mysqld.log -pid-file=/var/run/mysqld/mysqld.pid -default_authentication_plugin=mysql_native_password -skip-grant-tables diff --git a/test/integration/targets/setup_mysql8/handlers/main.yml b/test/integration/targets/setup_mysql8/handlers/main.yml deleted file mode 100644 index 6d30b5725c..0000000000 --- a/test/integration/targets/setup_mysql8/handlers/main.yml +++ /dev/null @@ -1,29 +0,0 @@ -- name: stop mysql service - service: - name: mysqld - state: stopped - listen: cleanup mysql8 - -- name: remove repo - # yum: - # name: mysql80-community-release - # state: absent - # Work around for a bug in the dnf module. Use the module once that gets fixed. - # https://github.com/ansible/ansible/issues/64294 - command: "{{ ansible_facts.pkg_mgr}} -y erase mysql80-community-release" - args: - warn: no - listen: cleanup mysql8 - -- name: remove mysql packages - yum: - name: '{{ mysql_support_packages | union(mysql_server_packages) | union(mysql_cleanup_packages) }}' - state: absent - listen: cleanup mysql8 - -- name: remove mysql data - file: - path: "{{ item }}" - state: absent - loop: "{{ mysql_data_dirs }}" - listen: cleanup mysql8 diff --git a/test/integration/targets/setup_mysql8/tasks/main.yml b/test/integration/targets/setup_mysql8/tasks/main.yml deleted file mode 100644 index 86ea1f8e0f..0000000000 --- a/test/integration/targets/setup_mysql8/tasks/main.yml +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright: (c) 2019, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru> -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - -# Setup MySQL 8: -- name: Include distribution specific variables - include_vars: "{{ lookup('first_found', params) }}" - vars: - params: - files: - - '{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_major_version }}.yml' - - '{{ ansible_facts.os_family }}.yml' - - 'default.yml' - paths: vars - -- import_tasks: setup_mysql8.yml - when: - - ansible_facts.distribution == 'CentOS' - - ansible_facts.distribution_major_version is version_compare('7', '>=') diff --git a/test/integration/targets/setup_mysql8/tasks/setup_mysql8.yml b/test/integration/targets/setup_mysql8/tasks/setup_mysql8.yml deleted file mode 100644 index 7f95301b41..0000000000 --- a/test/integration/targets/setup_mysql8/tasks/setup_mysql8.yml +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright: (c) 2019, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru> -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - -- name: Install MySQL repo - yum: - name: '{{ repo_link }}' - notify: cleanup mysql8 - -# These packages come from AppStream in RHEL 8, so they need to be done in a separate task -- name: Install MySQL support packages - yum: - name: "{{ mysql_support_packages }}" - notify: cleanup mysql8 - -- name: Install MySQL community server - yum: - name: '{{ mysql_server_packages }}' - disablerepo: '{{ mysql_disablerepo | default(omit) }}' - notify: cleanup mysql8 - -- name: Copy my.cnf - copy: - src: my.cnf - dest: '{{ my_cnf }}' - -- name: Start MySQL - service: - name: mysqld - state: started - -### Debug ####################### -#- name: Debug -# shell: cat /var/log/mysqld.log -################################# - -- name: Check connection to the server - shell: 'echo "SHOW DATABASES;" | mysql' - -- name: Check connection to the server - shell: "echo \"SHOW VARIABLES LIKE '%version%';\" | mysql" - -- name: Detect socket path - shell: 'echo "show variables like ''socket''\G" | mysql | grep ''Value: '' | sed ''s/[ ]\+Value: //''' - register: _socket_path - -- name: Set socket path - set_fact: - mysql_socket: '{{ _socket_path["stdout"] }}' - -- name: Set root pass - set_fact: - root_pass: "dlsafjlkjdsaK1#" - -- name: Set root password - shell: 'echo "flush privileges; ALTER USER ''root''@''localhost'' IDENTIFIED WITH mysql_native_password BY ''{{ root_pass }}'';" | mysql' - -- name: Change configuration - lineinfile: - path: '{{ my_cnf }}' - line: skip-grant-tables - state: absent - -- name: Restart MySQL - service: - name: mysqld - state: restarted diff --git a/test/integration/targets/setup_mysql8/vars/CentOS-8.yml b/test/integration/targets/setup_mysql8/vars/CentOS-8.yml deleted file mode 100644 index 3d61bda742..0000000000 --- a/test/integration/targets/setup_mysql8/vars/CentOS-8.yml +++ /dev/null @@ -1,4 +0,0 @@ -mysql_support_packages: - - python3-PyMySQL - -mysql_disablerepo: AppStream diff --git a/test/integration/targets/setup_mysql8/vars/Debian.yml b/test/integration/targets/setup_mysql8/vars/Debian.yml deleted file mode 100644 index 78323264f6..0000000000 --- a/test/integration/targets/setup_mysql8/vars/Debian.yml +++ /dev/null @@ -1,3 +0,0 @@ -mysql_data_dirs: - - /var/lib/mysql - - /usr/share/mysql diff --git a/test/integration/targets/setup_mysql8/vars/RedHat-8.yml b/test/integration/targets/setup_mysql8/vars/RedHat-8.yml deleted file mode 100644 index f636617585..0000000000 --- a/test/integration/targets/setup_mysql8/vars/RedHat-8.yml +++ /dev/null @@ -1,4 +0,0 @@ -mysql_support_packages: - - python3-PyMySQL - -mysql_disablerepo: rhel-8-for-x86_64-appstream-rpms diff --git a/test/integration/targets/setup_mysql8/vars/default.yml b/test/integration/targets/setup_mysql8/vars/default.yml deleted file mode 100644 index e69de29bb2..0000000000 --- a/test/integration/targets/setup_mysql8/vars/default.yml +++ /dev/null diff --git a/test/integration/targets/setup_mysql_db/defaults/main.yml b/test/integration/targets/setup_mysql_db/defaults/main.yml deleted file mode 100644 index 47712dc266..0000000000 --- a/test/integration/targets/setup_mysql_db/defaults/main.yml +++ /dev/null @@ -1,18 +0,0 @@ -mysql_service: mysqld - -mysql_packages: - - mysql-server - - MySQL-python - - bzip2 - -mysql_cleanup_packages: - - mysql-community-client - - mysql-community-common - - mysql-community-libs - - mysql-community-libs-compat - - mysql-community-server - - mysql80-community-release - -mysql_data_dirs: - - /var/lib/mysql - - /usr/mysql diff --git a/test/integration/targets/setup_mysql_db/handlers/main.yml b/test/integration/targets/setup_mysql_db/handlers/main.yml deleted file mode 100644 index abcd488ef2..0000000000 --- a/test/integration/targets/setup_mysql_db/handlers/main.yml +++ /dev/null @@ -1,25 +0,0 @@ -- name: stop mysql service - service: - name: "{{ mysql_service }}" - state: stopped - listen: cleanup mysql - -- name: remove mysql packages - action: '{{ ansible_pkg_mgr }}' - args: - name: "{{ item }}" - state: absent - loop: "{{ mysql_packages | union(mysql_cleanup_packages) }}" - listen: cleanup mysql - -- name: remove mysql data - file: - path: "{{ item }}" - state: absent - loop: "{{ mysql_data_dirs }}" - listen: cleanup mysql - -- name: remove pip packages - pip: - name: mysql-python - state: absent diff --git a/test/integration/targets/setup_mysql_db/tasks/main.yml b/test/integration/targets/setup_mysql_db/tasks/main.yml deleted file mode 100644 index 990cdb6e63..0000000000 --- a/test/integration/targets/setup_mysql_db/tasks/main.yml +++ /dev/null @@ -1,105 +0,0 @@ -# setup code for the mysql_db module -# (c) 2014, Wayne Rosario <wrosario@ansible.com> - -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see <http://www.gnu.org/licenses/>. - -# ============================================================ -- name: python 2 - set_fact: - python_suffix: "" - when: ansible_python_version is version('3', '<') - -- name: python 3 - set_fact: - python_suffix: "-py3" - when: ansible_python_version is version('3', '>=') - -- name: Include distribution specific variables - include_vars: "{{ lookup('first_found', params) }}" - vars: - params: - files: - - '{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_major_version }}{{ python_suffix }}.yml' - - '{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_major_version }}.yml' - - '{{ ansible_facts.os_family }}-{{ ansible_facts.distribution_major_version }}{{ python_suffix }}.yml' - - '{{ ansible_facts.os_family }}-{{ ansible_facts.distribution_major_version }}.yml' - - '{{ ansible_facts.distribution }}{{ python_suffix }}.yml' - - '{{ ansible_facts.os_family }}{{ python_suffix }}.yml' - - 'default{{ python_suffix }}.yml' - paths: "{{ role_path }}/vars" - -- name: install mysqldb_test rpm dependencies - yum: - name: "{{ mysql_packages }}" - state: latest - when: ansible_pkg_mgr == 'yum' - notify: cleanup mysql - -- name: install mysqldb_test rpm dependencies - dnf: - name: '{{ mysql_packages }}' - state: latest - install_weak_deps: False # mariadb-server has a weak dep on python2 which break Python 3 test environments - when: ansible_pkg_mgr == 'dnf' - notify: cleanup mysql - -- name: install mysqldb_test debian dependencies - apt: - name: "{{ mysql_packages }}" - state: latest - when: ansible_pkg_mgr == 'apt' - notify: cleanup mysql - -- name: install mysqldb_test FreeBSD dependencies - package: - name: "{{ mysql_packages }}" - state: present - when: ansible_os_family == "FreeBSD" - notify: cleanup mysql - -- name: install mysql-python package via pip (FreeBSD) - pip: - name: mysql-python - state: present - when: ansible_os_family == "FreeBSD" - notify: - - cleanup mysql - - remove pip packages - -- name: enable mysql-server service (FreeBSD) - lineinfile: - path: /etc/rc.conf - line: 'mysql_server_enable="YES"' - when: ansible_os_family == "FreeBSD" - -- name: apply work-around for OverlayFS issue - # https://github.com/docker/for-linux/issues/72#issuecomment-319904698 - command: find {{ mysql_data_dirs[0] }} -type f -exec touch {} ; - # find will fail if mysql has never been started, as the directory won't exist - ignore_errors: yes - -- name: restart mysql_db service - service: - name: "{{ mysql_service }}" - state: restarted - -- name: Detect socket path - shell: 'echo "show variables like ''socket''\G" | mysql | grep ''Value: '' | sed ''s/[ ]\+Value: //''' - register: _socket_path - -- name: Set socket path - set_fact: - mysql_socket: '{{ _socket_path["stdout"] }}' diff --git a/test/integration/targets/setup_mysql_db/vars/Debian.yml b/test/integration/targets/setup_mysql_db/vars/Debian.yml deleted file mode 100644 index 52062c703d..0000000000 --- a/test/integration/targets/setup_mysql_db/vars/Debian.yml +++ /dev/null @@ -1,16 +0,0 @@ -mysql_service: 'mysql' - -mysql_packages: - - mysql-server - - python-mysqldb - - bzip2 - -mysql_cleanup_packages: - - mysql-client* - - mysql-server* - - mysql-common - - mysql-sandbox - -mysql_data_dirs: - - /var/lib/mysql - - /usr/share/mysql diff --git a/test/integration/targets/setup_mysql_db/vars/Fedora-py3.yml b/test/integration/targets/setup_mysql_db/vars/Fedora-py3.yml deleted file mode 100644 index fa7d06e52a..0000000000 --- a/test/integration/targets/setup_mysql_db/vars/Fedora-py3.yml +++ /dev/null @@ -1,6 +0,0 @@ -mysql_service: 'mariadb' - -mysql_packages: - - mariadb-server - - python3-PyMySQL - - bzip2 diff --git a/test/integration/targets/setup_mysql_db/vars/Fedora.yml b/test/integration/targets/setup_mysql_db/vars/Fedora.yml deleted file mode 100644 index 718326ae08..0000000000 --- a/test/integration/targets/setup_mysql_db/vars/Fedora.yml +++ /dev/null @@ -1,6 +0,0 @@ -mysql_service: 'mariadb' - -mysql_packages: - - mariadb-server - - python-PyMySQL - - bzip2 diff --git a/test/integration/targets/setup_mysql_db/vars/FreeBSD.yml b/test/integration/targets/setup_mysql_db/vars/FreeBSD.yml deleted file mode 100644 index af45ebfd40..0000000000 --- a/test/integration/targets/setup_mysql_db/vars/FreeBSD.yml +++ /dev/null @@ -1,5 +0,0 @@ -mysql_service: 'mysql-server' - -mysql_packages: - - mariadb101-server - - py-pymysql diff --git a/test/integration/targets/setup_mysql_db/vars/RedHat-7.yml b/test/integration/targets/setup_mysql_db/vars/RedHat-7.yml deleted file mode 100644 index f8b29fd7a1..0000000000 --- a/test/integration/targets/setup_mysql_db/vars/RedHat-7.yml +++ /dev/null @@ -1,6 +0,0 @@ -mysql_service: 'mariadb' - -mysql_packages: - - mariadb-server - - MySQL-python - - bzip2 diff --git a/test/integration/targets/setup_mysql_db/vars/RedHat-8.yml b/test/integration/targets/setup_mysql_db/vars/RedHat-8.yml deleted file mode 100644 index fa7d06e52a..0000000000 --- a/test/integration/targets/setup_mysql_db/vars/RedHat-8.yml +++ /dev/null @@ -1,6 +0,0 @@ -mysql_service: 'mariadb' - -mysql_packages: - - mariadb-server - - python3-PyMySQL - - bzip2 diff --git a/test/integration/targets/setup_mysql_db/vars/RedHat.yml b/test/integration/targets/setup_mysql_db/vars/RedHat.yml deleted file mode 100644 index 742c35225b..0000000000 --- a/test/integration/targets/setup_mysql_db/vars/RedHat.yml +++ /dev/null @@ -1,6 +0,0 @@ -mysql_service: 'mysqld' - -mysql_packages: - - mysql-server - - MySQL-python - - bzip2 diff --git a/test/integration/targets/setup_mysql_db/vars/Suse-py3.yml b/test/integration/targets/setup_mysql_db/vars/Suse-py3.yml deleted file mode 100644 index adf2754d75..0000000000 --- a/test/integration/targets/setup_mysql_db/vars/Suse-py3.yml +++ /dev/null @@ -1,6 +0,0 @@ -mysql_service: 'mysql' - -mysql_packages: - - mariadb - - python3-PyMySQL - - bzip2 diff --git a/test/integration/targets/setup_mysql_db/vars/Suse.yml b/test/integration/targets/setup_mysql_db/vars/Suse.yml deleted file mode 100644 index a48a2e1330..0000000000 --- a/test/integration/targets/setup_mysql_db/vars/Suse.yml +++ /dev/null @@ -1,6 +0,0 @@ -mysql_service: 'mysql' - -mysql_packages: - - mariadb - - python-PyMySQL - - bzip2 diff --git a/test/integration/targets/setup_mysql_db/vars/Ubuntu-py3.yml b/test/integration/targets/setup_mysql_db/vars/Ubuntu-py3.yml deleted file mode 100644 index 7728244252..0000000000 --- a/test/integration/targets/setup_mysql_db/vars/Ubuntu-py3.yml +++ /dev/null @@ -1,16 +0,0 @@ -mysql_service: 'mysql' - -mysql_packages: - - mysql-server - - python3-pymysql - - bzip2 - -mysql_cleanup_packages: - - mysql-client* - - mysql-server* - - mysql-common - - mysql-sandbox - -mysql_data_dirs: - - /var/lib/mysql - - /usr/share/mysql diff --git a/test/integration/targets/setup_mysql_db/vars/default-py3.yml b/test/integration/targets/setup_mysql_db/vars/default-py3.yml deleted file mode 100644 index e69de29bb2..0000000000 --- a/test/integration/targets/setup_mysql_db/vars/default-py3.yml +++ /dev/null diff --git a/test/integration/targets/setup_mysql_db/vars/default.yml b/test/integration/targets/setup_mysql_db/vars/default.yml deleted file mode 100644 index e69de29bb2..0000000000 --- a/test/integration/targets/setup_mysql_db/vars/default.yml +++ /dev/null diff --git a/test/integration/targets/setup_mysql_replication/defaults/main.yml b/test/integration/targets/setup_mysql_replication/defaults/main.yml deleted file mode 100644 index ad06a0ad19..0000000000 --- a/test/integration/targets/setup_mysql_replication/defaults/main.yml +++ /dev/null @@ -1,14 +0,0 @@ -# There is no MySQL 5.7 for RHEL 8. This will need to be retooled to use 8.0 for RHEL 8 or use the setup_mysql8 role for everything -repo_link: https://repo.mysql.com/mysql57-community-release-el{{ ansible_facts.distribution_major_version }}.rpm -repo_name: mysql-community -mysql_package_name: mysql-community-server - -master_port: 3306 -standby_port: 3307 -master_datadir: /var/lib/mysql_master -master_cnf: /etc/my-1.cnf -standby_cnf: /etc/my-2.cnf -standby_datadir: /var/lib/mysql_standby -standby_logdir: /var/log/mysql_standby -default_logdir: /var/log/mysql -mysqld_err_log: '{{ default_logdir }}/mysql-err.log' diff --git a/test/integration/targets/setup_mysql_replication/tasks/main.yml b/test/integration/targets/setup_mysql_replication/tasks/main.yml deleted file mode 100644 index 0f507f74f1..0000000000 --- a/test/integration/targets/setup_mysql_replication/tasks/main.yml +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright: (c) 2019, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru> -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - -# Setup MySQL master-standby replication into one container: -- import_tasks: setup_mysql_cluster.yml - when: - - ansible_facts.distribution == 'CentOS' - - ansible_facts.distribution_major_version is version('7', '==') diff --git a/test/integration/targets/setup_mysql_replication/tasks/setup_mysql_cluster.yml b/test/integration/targets/setup_mysql_replication/tasks/setup_mysql_cluster.yml deleted file mode 100644 index 18d25ae732..0000000000 --- a/test/integration/targets/setup_mysql_replication/tasks/setup_mysql_cluster.yml +++ /dev/null @@ -1,60 +0,0 @@ -# We run two servers listening different ports -# to be able to check replication (one server for master, another for standby). - -- name: Install Repo - yum: - name: '{{ repo_link }}' - -- name: Install MySQL community server - yum: - name: '{{ mysql_package_name }}' - -- name: Create directories - file: - state: directory - path: "{{ item }}" - owner: mysql - group: mysql - loop: - - "{{ master_datadir }}" - - "{{ standby_datadir }}" - - "{{ standby_logdir }}" - - "{{ default_logdir }}" - -- name: Copy cnf templates - template: - src: '{{ item.conf_templ }}' - dest: '{{ item.conf_dest }}' - owner: mysql - group: mysql - force: yes - loop: - - { conf_templ: my-1.cnf.j2, conf_dest: '{{ master_cnf }}' } - - { conf_templ: my-2.cnf.j2, conf_dest: '{{ standby_cnf }}' } - -- name: Initialize DBs - shell: 'mysqld --user=mysql --initialize-insecure --datadir={{ item }}' - loop: - - '{{ master_datadir }}' - - '{{ standby_datadir }}' - -- name: Start master services - shell: 'mysqld --defaults-file={{ master_cnf }} --user=mysql --datadir={{ master_datadir }} --log-error={{ mysqld_err_log }} &' - -- name: Start standby services - shell: 'mysqld --defaults-file={{ standby_cnf }} --user=mysql --datadir={{ standby_datadir }} --log-error={{ mysqld_err_log }} &' - -- name: Pause - pause: seconds=3 - -########### For painful debug uncomment the lines below ## -#- name: DEBUG Check log -# shell: 'cat {{ mysqld_err_log }}' -# ignore_errors: yes -########################################################## - -- name: Check connection to the master - shell: 'echo "SHOW DATABASES;" | mysql -P {{ master_port }} -h 127.0.0.1' - -- name: Check connection to the standby - shell: "echo \"SHOW VARIABLES LIKE '%version%';\" | mysql -P {{ standby_port }} -h 127.0.0.1" diff --git a/test/integration/targets/setup_mysql_replication/templates/my-1.cnf.j2 b/test/integration/targets/setup_mysql_replication/templates/my-1.cnf.j2 deleted file mode 100644 index 7e8787afc0..0000000000 --- a/test/integration/targets/setup_mysql_replication/templates/my-1.cnf.j2 +++ /dev/null @@ -1,11 +0,0 @@ -[mysqld] -server_id = 1 -port = {{ master_port }} -datadir = {{ master_datadir }} -socket = {{ master_datadir }}/mysql.sock -pid-file = {{ master_datadir }}/mysql.pid -#mysqladmin = /usr/bin/mysqladmin -log_bin = /var/log/mysql/mysql-bin.log -sync_binlog = 1 -binlog-format = ROW -innodb_flush_log_at_trx_commit = 1 diff --git a/test/integration/targets/setup_mysql_replication/templates/my-2.cnf.j2 b/test/integration/targets/setup_mysql_replication/templates/my-2.cnf.j2 deleted file mode 100644 index 2d7550b8e5..0000000000 --- a/test/integration/targets/setup_mysql_replication/templates/my-2.cnf.j2 +++ /dev/null @@ -1,13 +0,0 @@ -[mysqld] -server_id = 2 -port = {{ standby_port }} -socket = /var/run/mysqld/mysqld_slave.sock -pid-file = /var/run/mysqld/mysqld_slave.pid -datadir = {{ standby_datadir }} -log_bin = {{ standby_logdir }}/mysql-bin.log -relay-log = {{ standby_logdir }}/relay-bin -relay-log-index = {{ standby_logdir }}/relay-bin.index -master-info-file = {{ standby_logdir }}/master.info -relay-log-info-file = {{ standby_logdir }}/relay-log.info -master-info-repository = TABLE -relay-log-info-repository = TABLE diff --git a/test/integration/targets/setup_opennebula/vars/main.yml b/test/integration/targets/setup_opennebula/vars/main.yml deleted file mode 100644 index 05cf47e2cf..0000000000 --- a/test/integration/targets/setup_opennebula/vars/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- - -opennebula_test: - hosts: - - hv1 - - hv2
\ No newline at end of file diff --git a/test/integration/targets/setup_openssl/tasks/main.yml b/test/integration/targets/setup_openssl/tasks/main.yml deleted file mode 100644 index 5a634458e2..0000000000 --- a/test/integration/targets/setup_openssl/tasks/main.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -- name: Include OS-specific variables - include_vars: '{{ ansible_os_family }}.yml' - when: not ansible_os_family == "Darwin" - -- name: Install OpenSSL - become: True - package: - name: '{{ openssl_package_name }}' - when: not ansible_os_family == 'Darwin' - -- name: Install pyOpenSSL (Python 3) - become: True - package: - name: '{{ pyopenssl_package_name_python3 }}' - when: not ansible_os_family == 'Darwin' and ansible_python_version is version('3.0', '>=') - -- name: Install pyOpenSSL (Python 2) - become: True - package: - name: '{{ pyopenssl_package_name }}' - when: not ansible_os_family == 'Darwin' and ansible_python_version is version('3.0', '<') - -- name: Install pyOpenSSL (Darwin) - become: True - pip: - name: pyOpenSSL - when: ansible_os_family == 'Darwin' - -- name: register pyOpenSSL version - command: "{{ ansible_python.executable }} -c 'import OpenSSL; print(OpenSSL.__version__)'" - register: pyopenssl_version - -- name: register openssl version - shell: "openssl version | cut -d' ' -f2" - register: openssl_version - -- name: register cryptography version - command: "{{ ansible_python.executable }} -c 'import cryptography; print(cryptography.__version__)'" - register: cryptography_version diff --git a/test/integration/targets/setup_openssl/vars/Debian.yml b/test/integration/targets/setup_openssl/vars/Debian.yml deleted file mode 100644 index 755c7a083c..0000000000 --- a/test/integration/targets/setup_openssl/vars/Debian.yml +++ /dev/null @@ -1,3 +0,0 @@ -pyopenssl_package_name: python-openssl -pyopenssl_package_name_python3: python3-openssl -openssl_package_name: openssl diff --git a/test/integration/targets/setup_openssl/vars/FreeBSD.yml b/test/integration/targets/setup_openssl/vars/FreeBSD.yml deleted file mode 100644 index 608689158a..0000000000 --- a/test/integration/targets/setup_openssl/vars/FreeBSD.yml +++ /dev/null @@ -1,3 +0,0 @@ -pyopenssl_package_name: py27-openssl -pyopenssl_package_name_python3: py36-openssl -openssl_package_name: openssl diff --git a/test/integration/targets/setup_openssl/vars/RedHat.yml b/test/integration/targets/setup_openssl/vars/RedHat.yml deleted file mode 100644 index 2959932cd7..0000000000 --- a/test/integration/targets/setup_openssl/vars/RedHat.yml +++ /dev/null @@ -1,3 +0,0 @@ -pyopenssl_package_name: pyOpenSSL -pyopenssl_package_name_python3: python3-pyOpenSSL -openssl_package_name: openssl diff --git a/test/integration/targets/setup_openssl/vars/Suse.yml b/test/integration/targets/setup_openssl/vars/Suse.yml deleted file mode 100644 index 2d5200f341..0000000000 --- a/test/integration/targets/setup_openssl/vars/Suse.yml +++ /dev/null @@ -1,3 +0,0 @@ -pyopenssl_package_name: python-pyOpenSSL -pyopenssl_package_name_python3: python3-pyOpenSSL -openssl_package_name: openssl diff --git a/test/integration/targets/setup_postgresql_db/defaults/main.yml b/test/integration/targets/setup_postgresql_db/defaults/main.yml deleted file mode 100644 index aea0244280..0000000000 --- a/test/integration/targets/setup_postgresql_db/defaults/main.yml +++ /dev/null @@ -1,17 +0,0 @@ -postgresql_service: postgresql - -postgresql_packages: - - postgresql-server - - python-psycopg2 - -pg_user: postgres -pg_group: root - -locale_latin_suffix: -locale_utf8_suffix: - -# defaults for test SSL -ssl_db: 'ssl_db' -ssl_user: 'ssl_user' -ssl_pass: 'ssl_pass' -ssl_rootcert: '~{{ pg_user }}/root.crt' diff --git a/test/integration/targets/setup_postgresql_db/files/dummy--1.0.sql b/test/integration/targets/setup_postgresql_db/files/dummy--1.0.sql deleted file mode 100644 index 53c79666b4..0000000000 --- a/test/integration/targets/setup_postgresql_db/files/dummy--1.0.sql +++ /dev/null @@ -1,2 +0,0 @@ -CREATE OR REPLACE FUNCTION dummy_display_ext_version() -RETURNS text LANGUAGE SQL AS 'SELECT (''1.0'')::text'; diff --git a/test/integration/targets/setup_postgresql_db/files/dummy--2.0.sql b/test/integration/targets/setup_postgresql_db/files/dummy--2.0.sql deleted file mode 100644 index 227ba1b4c4..0000000000 --- a/test/integration/targets/setup_postgresql_db/files/dummy--2.0.sql +++ /dev/null @@ -1,2 +0,0 @@ -CREATE OR REPLACE FUNCTION dummy_display_ext_version() -RETURNS text LANGUAGE SQL AS 'SELECT (''2.0'')::text'; diff --git a/test/integration/targets/setup_postgresql_db/files/dummy--3.0.sql b/test/integration/targets/setup_postgresql_db/files/dummy--3.0.sql deleted file mode 100644 index 7d6a60e543..0000000000 --- a/test/integration/targets/setup_postgresql_db/files/dummy--3.0.sql +++ /dev/null @@ -1,2 +0,0 @@ -CREATE OR REPLACE FUNCTION dummy_display_ext_version() -RETURNS text LANGUAGE SQL AS 'SELECT (''3.0'')::text'; diff --git a/test/integration/targets/setup_postgresql_db/files/dummy.control b/test/integration/targets/setup_postgresql_db/files/dummy.control deleted file mode 100644 index 4f8553c227..0000000000 --- a/test/integration/targets/setup_postgresql_db/files/dummy.control +++ /dev/null @@ -1,3 +0,0 @@ -comment = 'dummy extension used to test postgresql_ext Ansible module' -default_version = '3.0' -relocatable = true diff --git a/test/integration/targets/setup_postgresql_db/files/pg_hba.conf b/test/integration/targets/setup_postgresql_db/files/pg_hba.conf deleted file mode 100644 index 58de3607f9..0000000000 --- a/test/integration/targets/setup_postgresql_db/files/pg_hba.conf +++ /dev/null @@ -1,10 +0,0 @@ -# !!! This file managed by Ansible. Any local changes may be overwritten. !!! - -# Database administrative login by UNIX sockets -# note: you may wish to restrict this further later -local all {{ pg_user }} trust - -# TYPE DATABASE USER CIDR-ADDRESS METHOD -local all all md5 -host all all 127.0.0.1/32 md5 -host all all ::1/128 md5 diff --git a/test/integration/targets/setup_postgresql_db/tasks/main.yml b/test/integration/targets/setup_postgresql_db/tasks/main.yml deleted file mode 100644 index 651f6b3946..0000000000 --- a/test/integration/targets/setup_postgresql_db/tasks/main.yml +++ /dev/null @@ -1,215 +0,0 @@ -- name: python 2 - set_fact: - python_suffix: "" - when: ansible_python_version is version('3', '<') - -- name: python 3 - set_fact: - python_suffix: "-py3" - when: ansible_python_version is version('3', '>=') - -- name: Include distribution and Python version specific variables - include_vars: "{{ lookup('first_found', params) }}" - vars: - params: - files: - - '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}{{ python_suffix }}.yml' - - '{{ ansible_distribution }}-{{ ansible_distribution_version }}{{ python_suffix }}.yml' - - '{{ ansible_os_family }}{{ python_suffix }}.yml' - - 'default{{ python_suffix }}.yml' - paths: - - "{{ role_path }}/vars" - -- name: make sure the dbus service is started under systemd - systemd: - name: dbus - state: started - when: ansible_service_mgr == 'systemd' and ansible_distribution == 'Fedora' - -# Make sure we start fresh -- name: stop postgresql service - service: name={{ postgresql_service }} state=stopped - ignore_errors: True - -- name: remove old db (RedHat or Suse) - file: - path: "{{ pg_dir }}" - state: absent - ignore_errors: True - when: ansible_os_family == "RedHat" or ansible_os_family == "Suse" - -- name: remove old db (FreeBSD) - file: - path: "{{ pg_dir }}" - state: absent - ignore_errors: True - when: ansible_os_family == "FreeBSD" - -# Theoretically, pg_dropcluster should work but it doesn't so remove files -- name: remove old db config and files (debian) - file: - path: '{{ loop_item }}' - state: absent - ignore_errors: True - when: ansible_os_family == "Debian" - loop: - - /etc/postgresql - - /var/lib/postgresql - loop_control: - loop_var: loop_item - -- name: install dependencies for postgresql test - package: - name: "{{ postgresql_package_item }}" - state: present - with_items: "{{ postgresql_packages }}" - loop_control: - loop_var: postgresql_package_item - -- name: initialize postgres (FreeBSD) - command: /usr/local/etc/rc.d/postgresql oneinitdb - when: ansible_os_family == "FreeBSD" - -- name: Initialize postgres (RedHat systemd) - command: postgresql-setup initdb - when: ansible_os_family == "RedHat" and ansible_service_mgr == "systemd" - -- name: Initialize postgres (RedHat sysv) - command: /sbin/service postgresql initdb - when: ansible_os_family == "RedHat" and ansible_service_mgr != "systemd" - -- name: Initialize postgres (Debian) - shell: '. /usr/share/postgresql-common/maintscripts-functions && set_system_locale && /usr/bin/pg_createcluster -u postgres {{ pg_ver }} main' - args: - creates: "/etc/postgresql/{{ pg_ver }}/" - when: ansible_os_family == 'Debian' - -- name: Initialize postgres (Suse) - service: name=postgresql state=restarted - when: ansible_os_family == 'Suse' - -- name: Copy pg_hba into place - template: - src: files/pg_hba.conf - dest: "{{ pg_hba_location }}" - owner: "{{ pg_user }}" - group: "{{ pg_group }}" - mode: "0644" - -- name: Generate locales (Debian) - locale_gen: - name: '{{ item }}' - state: present - with_items: - - pt_BR - - es_ES - when: ansible_os_family == 'Debian' - -# Suse: locales are installed by default (glibc-locale package). -# Fedora 23: locales are installed by default (glibc-common package) -# CentOS: all locales are installed by default (glibc-common package) but some -# RPM macros could prevent their installation (for example when using anaconda -# instLangs parameter). - -- block: - - name: Install langpacks (RHEL8) - yum: - name: - - glibc-langpack-es - - glibc-langpack-pt - - glibc-all-langpacks - state: present - when: ansible_distribution_major_version is version('8', '>=') - - - name: Check if locales need to be generated (RedHat) - shell: "localedef --list-archive | grep -a -q '^{{ locale }}$'" - register: locale_present - ignore_errors: True - with_items: - - es_ES - - pt_BR - loop_control: - loop_var: locale - - - name: Reinstall internationalization files - shell: 'yum -y reinstall glibc-common || yum -y install glibc-common' - args: - warn: no - when: locale_present is failed - - - name: Generate locale (RedHat) - command: 'localedef -f ISO-8859-1 -i {{ item.locale }} {{ item.locale }}' - when: item is failed - with_items: '{{ locale_present.results }}' - when: ansible_os_family == 'RedHat' and ansible_distribution != 'Fedora' - -- name: Install glibc langpacks (Fedora >= 24) - package: - name: '{{ item }}' - state: 'latest' - with_items: - - glibc-langpack-es - - glibc-langpack-pt - when: ansible_distribution == 'Fedora' and ansible_distribution_major_version is version('24', '>=') - -- name: enable postgresql service (FreeBSD) - lineinfile: - path: /etc/rc.conf - line: 'postgresql_enable="YES"' - when: ansible_os_family == "FreeBSD" - -- name: start postgresql service - # work-around for issue on FreeBSD where service won't restart if currently stopped - service: name={{ postgresql_service }} state=started - -- name: restart postgresql service - service: name={{ postgresql_service }} state=restarted - -######################## -# Setup dummy extension: -- name: copy control file for dummy ext - copy: - src: dummy.control - dest: "/usr/share/postgresql/{{ pg_ver }}/extension/dummy.control" - mode: 0444 - when: ansible_os_family == 'Debian' - -- name: copy version files for dummy ext - copy: - src: "{{ item }}" - dest: "/usr/share/postgresql/{{ pg_ver }}/extension/{{ item }}" - mode: 0444 - with_items: - - dummy--1.0.sql - - dummy--2.0.sql - - dummy--3.0.sql - when: ansible_os_family == 'Debian' - -- name: add update paths - file: - path: "/usr/share/postgresql/{{ pg_ver }}/extension/{{ item }}" - mode: 0444 - state: touch - with_items: - - dummy--1.0--2.0.sql - - dummy--2.0--3.0.sql - when: ansible_os_family == 'Debian' - -- name: Get PostgreSQL version - become_user: "{{ pg_user }}" - become: yes - shell: "echo 'SHOW SERVER_VERSION' | psql --tuples-only --no-align --dbname postgres" - register: postgres_version_resp - -- name: Print PostgreSQL server version - debug: - msg: "{{ postgres_version_resp.stdout }}" - -# SSL configuration. -# Restricted using Debian family because of there are errors on other distributions -# that not related with PostgreSQL or psycopg2 SSL support. -# The tests key point is to be sure that ssl options work in general -- import_tasks: ssl.yml - when: - - ansible_os_family == 'Debian' - - postgres_version_resp.stdout is version('9.4', '>=') diff --git a/test/integration/targets/setup_postgresql_db/tasks/ssl.yml b/test/integration/targets/setup_postgresql_db/tasks/ssl.yml deleted file mode 100644 index bc45ec6f4b..0000000000 --- a/test/integration/targets/setup_postgresql_db/tasks/ssl.yml +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright: (c) 2019, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru> -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - -# The aim of this test is to be sure that SSL options work in general -# and preparing the environment for testing these options in -# the following PostgreSQL modules (ssl_db, ssl_user, certs). -# Configured by https://www.postgresql.org/docs/current/ssl-tcp.html - -#################### -# Prepare for tests: - -- name: postgresql SSL - create database - become_user: "{{ pg_user }}" - become: yes - postgresql_db: - name: "{{ ssl_db }}" - -- name: postgresql SSL - create role - become_user: "{{ pg_user }}" - become: yes - postgresql_user: - name: "{{ ssl_user }}" - role_attr_flags: SUPERUSER - password: "{{ ssl_pass }}" - -- name: postgresql SSL - install openssl - become: yes - package: name=openssl state=present - -- name: postgresql SSL - create certs 1 - become_user: root - become: yes - shell: 'openssl req -new -nodes -text -out ~{{ pg_user }}/root.csr \ - -keyout ~{{ pg_user }}/root.key -subj "/CN=localhost.local"' - -- name: postgresql SSL - create certs 2 - become_user: root - become: yes - shell: 'openssl x509 -req -in ~{{ pg_user }}/root.csr -text -days 3650 \ - -extensions v3_ca -signkey ~{{ pg_user }}/root.key -out ~{{ pg_user }}/root.crt' - -- name: postgresql SSL - create certs 3 - become_user: root - become: yes - shell: 'openssl req -new -nodes -text -out ~{{ pg_user }}/server.csr \ - -keyout ~{{ pg_user }}/server.key -subj "/CN=localhost.local"' - -- name: postgresql SSL - create certs 4 - become_user: root - become: yes - shell: 'openssl x509 -req -in ~{{ pg_user }}/server.csr -text -days 365 \ - -CA ~{{ pg_user }}/root.crt -CAkey ~{{ pg_user }}/root.key -CAcreateserial -out server.crt' - -- name: postgresql SSL - set right permissions to files - become_user: root - become: yes - file: - path: '{{ item }}' - mode: 0600 - owner: '{{ pg_user }}' - group: '{{ pg_user }}' - with_items: - - '~{{ pg_user }}/root.key' - - '~{{ pg_user }}/server.key' - - '~{{ pg_user }}/root.crt' - - '~{{ pg_user }}/server.csr' - -- name: postgresql SSL - enable SSL - become_user: "{{ pg_user }}" - become: yes - postgresql_set: - login_user: "{{ pg_user }}" - db: postgres - name: ssl - value: on - -- name: postgresql SSL - reload PostgreSQL to enable ssl on - become: yes - service: - name: "{{ postgresql_service }}" - state: reloaded diff --git a/test/integration/targets/setup_postgresql_db/vars/Debian-8.yml b/test/integration/targets/setup_postgresql_db/vars/Debian-8.yml deleted file mode 100644 index c5c6795eac..0000000000 --- a/test/integration/targets/setup_postgresql_db/vars/Debian-8.yml +++ /dev/null @@ -1,8 +0,0 @@ -postgresql_packages: - - "postgresql" - - "postgresql-common" - - "python-psycopg2" - -pg_hba_location: "/etc/postgresql/9.4/main/pg_hba.conf" -pg_dir: "/var/lib/postgresql/9.4/main" -pg_ver: 9.4 diff --git a/test/integration/targets/setup_postgresql_db/vars/FreeBSD-11-py3.yml b/test/integration/targets/setup_postgresql_db/vars/FreeBSD-11-py3.yml deleted file mode 100644 index 2f6b0d9846..0000000000 --- a/test/integration/targets/setup_postgresql_db/vars/FreeBSD-11-py3.yml +++ /dev/null @@ -1,12 +0,0 @@ -postgresql_packages: - - postgresql95-server - - py36-psycopg2 - -pg_dir: /usr/local/pgsql/data -pg_hba_location: "{{ pg_dir }}/pg_hba.conf" -pg_ver: 9.5 -pg_user: pgsql -pg_group: pgsql - -locale_latin_suffix: .ISO8859-1 -locale_utf8_suffix: .UTF-8 diff --git a/test/integration/targets/setup_postgresql_db/vars/FreeBSD-11.yml b/test/integration/targets/setup_postgresql_db/vars/FreeBSD-11.yml deleted file mode 100644 index efb0603b5e..0000000000 --- a/test/integration/targets/setup_postgresql_db/vars/FreeBSD-11.yml +++ /dev/null @@ -1,12 +0,0 @@ -postgresql_packages: - - postgresql95-server - - py27-psycopg2 - -pg_dir: /usr/local/pgsql/data -pg_hba_location: "{{ pg_dir }}/pg_hba.conf" -pg_ver: 9.5 -pg_user: pgsql -pg_group: pgsql - -locale_latin_suffix: .ISO8859-1 -locale_utf8_suffix: .UTF-8 diff --git a/test/integration/targets/setup_postgresql_db/vars/FreeBSD-12.0-py3.yml b/test/integration/targets/setup_postgresql_db/vars/FreeBSD-12.0-py3.yml deleted file mode 100644 index 2f6b0d9846..0000000000 --- a/test/integration/targets/setup_postgresql_db/vars/FreeBSD-12.0-py3.yml +++ /dev/null @@ -1,12 +0,0 @@ -postgresql_packages: - - postgresql95-server - - py36-psycopg2 - -pg_dir: /usr/local/pgsql/data -pg_hba_location: "{{ pg_dir }}/pg_hba.conf" -pg_ver: 9.5 -pg_user: pgsql -pg_group: pgsql - -locale_latin_suffix: .ISO8859-1 -locale_utf8_suffix: .UTF-8 diff --git a/test/integration/targets/setup_postgresql_db/vars/FreeBSD-12.0.yml b/test/integration/targets/setup_postgresql_db/vars/FreeBSD-12.0.yml deleted file mode 100644 index 1fe6678262..0000000000 --- a/test/integration/targets/setup_postgresql_db/vars/FreeBSD-12.0.yml +++ /dev/null @@ -1,12 +0,0 @@ -postgresql_packages: - - postgresql96-server - - py27-psycopg2 - -pg_dir: /usr/local/pgsql/data -pg_hba_location: "{{ pg_dir }}/pg_hba.conf" -pg_ver: 9.6 -pg_user: pgsql -pg_group: pgsql - -locale_latin_suffix: .ISO8859-1 -locale_utf8_suffix: .UTF-8 diff --git a/test/integration/targets/setup_postgresql_db/vars/FreeBSD-12.1-py3.yml b/test/integration/targets/setup_postgresql_db/vars/FreeBSD-12.1-py3.yml deleted file mode 100644 index cd7c83a4c1..0000000000 --- a/test/integration/targets/setup_postgresql_db/vars/FreeBSD-12.1-py3.yml +++ /dev/null @@ -1,12 +0,0 @@ -postgresql_packages: - - postgresql11-server - - py36-psycopg2 - -pg_dir: /var/db/postgres/data11 -pg_hba_location: "{{ pg_dir }}/pg_hba.conf" -pg_ver: 11 -pg_user: postgres -pg_group: postgres - -locale_latin_suffix: .ISO8859-1 -locale_utf8_suffix: .UTF-8 diff --git a/test/integration/targets/setup_postgresql_db/vars/FreeBSD-12.1.yml b/test/integration/targets/setup_postgresql_db/vars/FreeBSD-12.1.yml deleted file mode 100644 index 0b1ab5b26e..0000000000 --- a/test/integration/targets/setup_postgresql_db/vars/FreeBSD-12.1.yml +++ /dev/null @@ -1,12 +0,0 @@ -postgresql_packages: - - postgresql11-server - - py27-psycopg2 - -pg_dir: /var/db/postgres/data11 -pg_hba_location: "{{ pg_dir }}/pg_hba.conf" -pg_ver: 11 -pg_user: postgres -pg_group: postgres - -locale_latin_suffix: .ISO8859-1 -locale_utf8_suffix: .UTF-8 diff --git a/test/integration/targets/setup_postgresql_db/vars/RedHat-py3.yml b/test/integration/targets/setup_postgresql_db/vars/RedHat-py3.yml deleted file mode 100644 index ee08372226..0000000000 --- a/test/integration/targets/setup_postgresql_db/vars/RedHat-py3.yml +++ /dev/null @@ -1,8 +0,0 @@ -postgresql_packages: - - "postgresql-server" - - "python3-psycopg2" - - "bzip2" - - "xz" - -pg_hba_location: "/var/lib/pgsql/data/pg_hba.conf" -pg_dir: "/var/lib/pgsql/data" diff --git a/test/integration/targets/setup_postgresql_db/vars/RedHat.yml b/test/integration/targets/setup_postgresql_db/vars/RedHat.yml deleted file mode 100644 index 20c4b1f5b7..0000000000 --- a/test/integration/targets/setup_postgresql_db/vars/RedHat.yml +++ /dev/null @@ -1,7 +0,0 @@ -postgresql_packages: - - "postgresql-server" - - "python-psycopg2" - - "bzip2" - -pg_hba_location: "/var/lib/pgsql/data/pg_hba.conf" -pg_dir: "/var/lib/pgsql/data" diff --git a/test/integration/targets/setup_postgresql_db/vars/Ubuntu-12.yml b/test/integration/targets/setup_postgresql_db/vars/Ubuntu-12.yml deleted file mode 100644 index 4b6e744b44..0000000000 --- a/test/integration/targets/setup_postgresql_db/vars/Ubuntu-12.yml +++ /dev/null @@ -1,8 +0,0 @@ -postgresql_packages: - - "postgresql" - - "postgresql-common" - - "python-psycopg2" - -pg_hba_location: "/etc/postgresql/9.1/main/pg_hba.conf" -pg_dir: "/var/lib/postgresql/9.1/main" -pg_ver: 9.1 diff --git a/test/integration/targets/setup_postgresql_db/vars/Ubuntu-14.yml b/test/integration/targets/setup_postgresql_db/vars/Ubuntu-14.yml deleted file mode 100644 index ffcc8dd496..0000000000 --- a/test/integration/targets/setup_postgresql_db/vars/Ubuntu-14.yml +++ /dev/null @@ -1,8 +0,0 @@ -postgresql_packages: - - "postgresql" - - "postgresql-common" - - "python-psycopg2" - -pg_hba_location: "/etc/postgresql/9.3/main/pg_hba.conf" -pg_dir: "/var/lib/postgresql/9.3/main" -pg_ver: 9.3 diff --git a/test/integration/targets/setup_postgresql_db/vars/Ubuntu-16-py3.yml b/test/integration/targets/setup_postgresql_db/vars/Ubuntu-16-py3.yml deleted file mode 100644 index b088c3105e..0000000000 --- a/test/integration/targets/setup_postgresql_db/vars/Ubuntu-16-py3.yml +++ /dev/null @@ -1,8 +0,0 @@ -postgresql_packages: - - "postgresql" - - "postgresql-common" - - "python3-psycopg2" - -pg_hba_location: "/etc/postgresql/9.5/main/pg_hba.conf" -pg_dir: "/var/lib/postgresql/9.5/main" -pg_ver: 9.5 diff --git a/test/integration/targets/setup_postgresql_db/vars/Ubuntu-16.yml b/test/integration/targets/setup_postgresql_db/vars/Ubuntu-16.yml deleted file mode 100644 index 897efd2c76..0000000000 --- a/test/integration/targets/setup_postgresql_db/vars/Ubuntu-16.yml +++ /dev/null @@ -1,8 +0,0 @@ -postgresql_packages: - - "postgresql" - - "postgresql-common" - - "python-psycopg2" - -pg_hba_location: "/etc/postgresql/9.5/main/pg_hba.conf" -pg_dir: "/var/lib/postgresql/9.5/main" -pg_ver: 9.5 diff --git a/test/integration/targets/setup_postgresql_db/vars/Ubuntu-18-py3.yml b/test/integration/targets/setup_postgresql_db/vars/Ubuntu-18-py3.yml deleted file mode 100644 index 10453bdf90..0000000000 --- a/test/integration/targets/setup_postgresql_db/vars/Ubuntu-18-py3.yml +++ /dev/null @@ -1,8 +0,0 @@ -postgresql_packages: - - "postgresql" - - "postgresql-common" - - "python3-psycopg2" - -pg_hba_location: "/etc/postgresql/10/main/pg_hba.conf" -pg_dir: "/var/lib/postgresql/10/main" -pg_ver: 10 diff --git a/test/integration/targets/setup_postgresql_db/vars/default-py3.yml b/test/integration/targets/setup_postgresql_db/vars/default-py3.yml deleted file mode 100644 index 19152a6435..0000000000 --- a/test/integration/targets/setup_postgresql_db/vars/default-py3.yml +++ /dev/null @@ -1,6 +0,0 @@ -postgresql_packages: - - "postgresql-server" - - "python3-psycopg2" - -pg_hba_location: "/var/lib/pgsql/data/pg_hba.conf" -pg_dir: "/var/lib/pgsql/data" diff --git a/test/integration/targets/setup_postgresql_db/vars/default.yml b/test/integration/targets/setup_postgresql_db/vars/default.yml deleted file mode 100644 index ab36dd9f1d..0000000000 --- a/test/integration/targets/setup_postgresql_db/vars/default.yml +++ /dev/null @@ -1,6 +0,0 @@ -postgresql_packages: - - "postgresql-server" - - "python-psycopg2" - -pg_hba_location: "/var/lib/pgsql/data/pg_hba.conf" -pg_dir: "/var/lib/pgsql/data" diff --git a/test/integration/targets/setup_postgresql_replication/defaults/main.yml b/test/integration/targets/setup_postgresql_replication/defaults/main.yml deleted file mode 100644 index 1b1d8b4152..0000000000 --- a/test/integration/targets/setup_postgresql_replication/defaults/main.yml +++ /dev/null @@ -1,30 +0,0 @@ -# General: -pg_user: postgres -db_default: postgres - -pg_package_list: -- apt-utils -- postgresql -- postgresql-contrib -- python3-psycopg2 - -packages_to_remove: -- postgresql -- postgresql-contrib -- postgresql-server -- postgresql-libs -- python3-psycopg2 - -# Master specific defaults: -master_root_dir: '/var/lib/pgsql/master' -master_data_dir: '{{ master_root_dir }}/data' -master_postgresql_conf: '{{ master_data_dir }}/postgresql.conf' -master_pg_hba_conf: '{{ master_data_dir }}/pg_hba.conf' -master_port: 5433 - -# Replica specific defaults: -replica_root_dir: '/var/lib/pgsql/replica' -replica_data_dir: '{{ replica_root_dir }}/data' -replica_postgresql_conf: '{{ replica_data_dir }}/postgresql.conf' -replica_pg_hba_conf: '{{ replica_data_dir }}/pg_hba.conf' -replica_port: 5434 diff --git a/test/integration/targets/setup_postgresql_replication/handlers/main.yml b/test/integration/targets/setup_postgresql_replication/handlers/main.yml deleted file mode 100644 index 7f4dc5cc14..0000000000 --- a/test/integration/targets/setup_postgresql_replication/handlers/main.yml +++ /dev/null @@ -1,23 +0,0 @@ -- name: Stop services - become: yes - become_user: '{{ pg_user }}' - shell: '{{ pg_ctl }} -D {{ item.datadir }} -o "-p {{ item.port }}" -m immediate stop' - loop: - - { datadir: '{{ master_data_dir }}', port: '{{ master_port }}' } - - { datadir: '{{ replica_data_dir }}', port: '{{ replica_port }}' } - listen: stop postgresql - -- name: Remove packages - apt: - name: '{{ packages_to_remove }}' - state: absent - listen: cleanup postgresql - -- name: Remove FS objects - file: - state: absent - path: "{{ item }}" - loop: - - "{{ master_root_dir }}" - - "{{ replica_root_dir }}" - listen: cleanup postgresql diff --git a/test/integration/targets/setup_postgresql_replication/tasks/main.yml b/test/integration/targets/setup_postgresql_replication/tasks/main.yml deleted file mode 100644 index 357b5da0ba..0000000000 --- a/test/integration/targets/setup_postgresql_replication/tasks/main.yml +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright: (c) 2019, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru> -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - -# Setup PostgreSQL master-standby replication into one container: -- import_tasks: setup_postgresql_cluster.yml - when: - - ansible_distribution == 'Ubuntu' - - ansible_distribution_major_version >= '18' diff --git a/test/integration/targets/setup_postgresql_replication/tasks/setup_postgresql_cluster.yml b/test/integration/targets/setup_postgresql_replication/tasks/setup_postgresql_cluster.yml deleted file mode 100644 index ab451892d8..0000000000 --- a/test/integration/targets/setup_postgresql_replication/tasks/setup_postgresql_cluster.yml +++ /dev/null @@ -1,93 +0,0 @@ -# We run two servers listening different ports -# to be able to check replication (one server for master, another for standby). - -- name: Install packages - apt: - name: '{{ pg_package_list }}' - notify: cleanup postgresql - -- name: Create root dirs - file: - state: directory - path: "{{ item }}" - owner: postgres - group: postgres - mode: 0700 - loop: - - "{{ master_root_dir }}" - - "{{ master_data_dir }}" - - "{{ replica_root_dir }}" - - "{{ replica_data_dir }}" - notify: cleanup postgresql - -- name: Find initdb - shell: find /usr/lib -type f -name "initdb" - register: result - -- name: Set path to initdb - set_fact: - initdb: '{{ result.stdout }}' - -- name: Initialize databases - become: yes - become_user: '{{ pg_user }}' - shell: '{{ initdb }} --pgdata {{ item }}' - loop: - - "{{ master_data_dir }}" - - "{{ replica_data_dir }}" - -- name: Copy config templates - template: - src: '{{ item.conf_templ }}' - dest: '{{ item.conf_dest }}' - owner: postgres - group: postgres - force: yes - loop: - - { conf_templ: master_postgresql.conf.j2, conf_dest: '{{ master_postgresql_conf }}' } - - { conf_templ: replica_postgresql.conf.j2, conf_dest: '{{ replica_postgresql_conf }}' } - - { conf_templ: pg_hba.conf.j2, conf_dest: '{{ master_pg_hba_conf }}' } - - { conf_templ: pg_hba.conf.j2, conf_dest: '{{ replica_pg_hba_conf }}' } - -- name: Find pg_ctl - shell: find /usr/lib -type f -name "pg_ctl" - register: result - -- name: Set path to initdb - set_fact: - pg_ctl: '{{ result.stdout }}' - -- name: Start servers - become: yes - become_user: '{{ pg_user }}' - shell: '{{ pg_ctl }} -D {{ item.datadir }} -o "-p {{ item.port }}" start' - loop: - - { datadir: '{{ master_data_dir }}', port: '{{ master_port }}' } - - { datadir: '{{ replica_data_dir }}', port: '{{ replica_port }}' } - notify: stop postgresql - -- name: Check connectivity to the master and get PostgreSQL version - become: yes - become_user: '{{ pg_user }}' - postgresql_ping: - db: '{{ db_default }}' - login_user: '{{ pg_user }}' - login_port: '{{ master_port }}' - register: result - -- name: Check connectivity to the replica and get PostgreSQL version - become: yes - become_user: '{{ pg_user }}' - postgresql_ping: - db: '{{ db_default }}' - login_user: '{{ pg_user }}' - login_port: '{{ replica_port }}' - -- name: Define server version - set_fact: - pg_major_version: '{{ result.server_version.major }}' - pg_minor_version: '{{ result.server_version.minor }}' - -- name: Print PostgreSQL version - debug: - msg: 'PostgreSQL version is {{ pg_major_version }}.{{ pg_minor_version }}' diff --git a/test/integration/targets/setup_postgresql_replication/templates/master_postgresql.conf.j2 b/test/integration/targets/setup_postgresql_replication/templates/master_postgresql.conf.j2 deleted file mode 100644 index 744243ff66..0000000000 --- a/test/integration/targets/setup_postgresql_replication/templates/master_postgresql.conf.j2 +++ /dev/null @@ -1,28 +0,0 @@ -# Important parameters: -listen_addresses='*' -port = {{ master_port }} -wal_level = logical -max_wal_senders = 8 -track_commit_timestamp = on -max_replication_slots = 10 - -# Unimportant parameters: -max_connections=10 -shared_buffers=8MB -dynamic_shared_memory_type=posix -log_destination='stderr' -logging_collector=on -log_directory='log' -log_filename='postgresql-%a.log' -log_truncate_on_rotation=on -log_rotation_age=1d -log_rotation_size=0 -log_line_prefix='%m[%p]' -log_timezone='W-SU' -datestyle='iso,mdy' -timezone='W-SU' -lc_messages='en_US.UTF-8' -lc_monetary='en_US.UTF-8' -lc_numeric='en_US.UTF-8' -lc_time='en_US.UTF-8' -default_text_search_config='pg_catalog.english' diff --git a/test/integration/targets/setup_postgresql_replication/templates/pg_hba.conf.j2 b/test/integration/targets/setup_postgresql_replication/templates/pg_hba.conf.j2 deleted file mode 100644 index 62e05ffc82..0000000000 --- a/test/integration/targets/setup_postgresql_replication/templates/pg_hba.conf.j2 +++ /dev/null @@ -1,7 +0,0 @@ -local all all trust -local replication logical_replication trust -host replication logical_replication 127.0.0.1/32 trust -host replication logical_replication 0.0.0.0/0 trust -local all logical_replication trust -host all logical_replication 127.0.0.1/32 trust -host all logical_replication 0.0.0.0/0 trust diff --git a/test/integration/targets/setup_postgresql_replication/templates/replica_postgresql.conf.j2 b/test/integration/targets/setup_postgresql_replication/templates/replica_postgresql.conf.j2 deleted file mode 100644 index 206ab2eb3a..0000000000 --- a/test/integration/targets/setup_postgresql_replication/templates/replica_postgresql.conf.j2 +++ /dev/null @@ -1,28 +0,0 @@ -# Important parameters: -listen_addresses='*' -port = {{ replica_port }} -wal_level = logical -max_wal_senders = 8 -track_commit_timestamp = on -max_replication_slots = 10 - -# Unimportant parameters: -max_connections=10 -shared_buffers=8MB -dynamic_shared_memory_type=posix -log_destination='stderr' -logging_collector=on -log_directory='log' -log_filename='postgresql-%a.log' -log_truncate_on_rotation=on -log_rotation_age=1d -log_rotation_size=0 -log_line_prefix='%m[%p]' -log_timezone='W-SU' -datestyle='iso,mdy' -timezone='W-SU' -lc_messages='en_US.UTF-8' -lc_monetary='en_US.UTF-8' -lc_numeric='en_US.UTF-8' -lc_time='en_US.UTF-8' -default_text_search_config='pg_catalog.english' diff --git a/test/integration/targets/setup_rabbitmq/files/rabbitmq.conf b/test/integration/targets/setup_rabbitmq/files/rabbitmq.conf deleted file mode 100644 index 1e602175bd..0000000000 --- a/test/integration/targets/setup_rabbitmq/files/rabbitmq.conf +++ /dev/null @@ -1,8 +0,0 @@ -listeners.ssl.default = 5671 - -ssl_options.cacertfile = /tls/ca_certificate.pem -ssl_options.certfile = /tls/server_certificate.pem -ssl_options.keyfile = /tls/server_key.pem -ssl_options.password = bunnies -ssl_options.verify = verify_peer -ssl_options.fail_if_no_peer_cert = false diff --git a/test/integration/targets/setup_rabbitmq/meta/main.yml b/test/integration/targets/setup_rabbitmq/meta/main.yml deleted file mode 100644 index af05db79d4..0000000000 --- a/test/integration/targets/setup_rabbitmq/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - setup_tls diff --git a/test/integration/targets/setup_rabbitmq/tasks/main.yml b/test/integration/targets/setup_rabbitmq/tasks/main.yml deleted file mode 100644 index 4f35f16f62..0000000000 --- a/test/integration/targets/setup_rabbitmq/tasks/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- include: ubuntu.yml - when: ansible_distribution == 'Ubuntu' diff --git a/test/integration/targets/setup_rabbitmq/tasks/ubuntu.yml b/test/integration/targets/setup_rabbitmq/tasks/ubuntu.yml deleted file mode 100644 index 6d7a3ef0d9..0000000000 --- a/test/integration/targets/setup_rabbitmq/tasks/ubuntu.yml +++ /dev/null @@ -1,63 +0,0 @@ ---- -# https://www.rabbitmq.com/install-debian.html#apt-pinning -- name: Pin erlang version that rabbitmq supports - copy: - dest: /etc/apt/preferences.d/erlang - content: | - Package: erlang* - Pin: version 1:20.3.8.18-1 - Pin-Priority: 1000 - - Package: esl-erlang - Pin: version 1:20.3.6 - Pin-Priority: 1000 - -- name: Install https transport for apt - apt: - name: apt-transport-https - state: latest - force: yes - -- name: Add RabbitMQ release signing key - apt_key: - url: https://ansible-ci-files.s3.amazonaws.com/test/integration/targets/setup_rabbitmq/rabbitmq-release-signing-key.asc - state: present - -- name: Add RabbitMQ Erlang repository - apt_repository: - repo: "deb https://dl.bintray.com/rabbitmq-erlang/debian {{ ansible_distribution_release }} erlang-20.x" - filename: 'rabbitmq-erlang' - state: present - update_cache: yes - -# Required by the rabbitmq modules that uses the management API -- name: Install requests - pip: - name: requests - -- name: Install RabbitMQ Server - apt: - deb: https://s3.amazonaws.com/ansible-ci-files/test/integration/targets/setup_rabbitmq/rabbitmq-server_3.7.14-1_all.deb - -- name: Install RabbitMQ TLS dependencies - apt: - name: "{{ item }}" - state: latest - loop: - - erlang-asn1 - - erlang-crypto - - erlang-public-key - - erlang-ssl - -- name: Ensure TLS config - copy: - src: rabbitmq.conf - dest: /etc/rabbitmq/rabbitmq.conf - -- name: Start RabbitMQ service - service: - name: rabbitmq-server - state: started - -- name: Enable management - command: rabbitmq-plugins enable --online rabbitmq_management diff --git a/test/integration/targets/setup_ssh_keygen/tasks/main.yml b/test/integration/targets/setup_ssh_keygen/tasks/main.yml deleted file mode 100644 index 885356d789..0000000000 --- a/test/integration/targets/setup_ssh_keygen/tasks/main.yml +++ /dev/null @@ -1,8 +0,0 @@ -- name: Include OS-specific variables - include_vars: '{{ ansible_os_family }}.yml' - when: not ansible_os_family == "Darwin" and not ansible_os_family == "FreeBSD" - -- name: Install ssh-keygen - package: - name: '{{ openssh_client_package_name }}' - when: not ansible_os_family == "Darwin" and not ansible_os_family == "FreeBSD" diff --git a/test/integration/targets/setup_ssh_keygen/vars/Debian.yml b/test/integration/targets/setup_ssh_keygen/vars/Debian.yml deleted file mode 100644 index d7ff0c734e..0000000000 --- a/test/integration/targets/setup_ssh_keygen/vars/Debian.yml +++ /dev/null @@ -1 +0,0 @@ -openssh_client_package_name: openssh-client diff --git a/test/integration/targets/setup_ssh_keygen/vars/RedHat.yml b/test/integration/targets/setup_ssh_keygen/vars/RedHat.yml deleted file mode 100644 index bc656edfad..0000000000 --- a/test/integration/targets/setup_ssh_keygen/vars/RedHat.yml +++ /dev/null @@ -1 +0,0 @@ -openssh_client_package_name: openssh-clients diff --git a/test/integration/targets/setup_ssh_keygen/vars/Suse.yml b/test/integration/targets/setup_ssh_keygen/vars/Suse.yml deleted file mode 100644 index 4091fa7b8b..0000000000 --- a/test/integration/targets/setup_ssh_keygen/vars/Suse.yml +++ /dev/null @@ -1 +0,0 @@ -openssh_client_package_name: openssh diff --git a/test/integration/targets/setup_sshkey/tasks/main.yml b/test/integration/targets/setup_sshkey/tasks/main.yml deleted file mode 100644 index 18c571b671..0000000000 --- a/test/integration/targets/setup_sshkey/tasks/main.yml +++ /dev/null @@ -1,55 +0,0 @@ -# (c) 2014, James Laska <jlaska@ansible.com> - -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see <http://www.gnu.org/licenses/>. - -- name: create a temp file - tempfile: - state: file - register: sshkey_file - tags: - - prepare - -- name: generate sshkey - shell: echo 'y' | ssh-keygen -P '' -f {{ sshkey_file.path }} - tags: - - prepare - -- name: create another temp file - tempfile: - state: file - register: another_sshkey_file - tags: - - prepare - -- name: generate another_sshkey - shell: echo 'y' | ssh-keygen -P '' -f {{ another_sshkey_file.path }} - tags: - - prepare - -- name: record fingerprint - shell: openssl rsa -in {{ sshkey_file.path }} -pubout -outform DER 2>/dev/null | openssl md5 -c - register: fingerprint - tags: - - prepare - -- name: set facts for future roles - set_fact: - sshkey: '{{ sshkey_file.path }}' - key_material: "{{ lookup('file', sshkey_file.path ~ '.pub') }}" - another_key_material: "{{ lookup('file', another_sshkey_file.path ~ '.pub') }}" - fingerprint: '{{ fingerprint.stdout.split()[1] }}' - tags: - - prepare diff --git a/test/integration/targets/setup_tls/files/ca_certificate.pem b/test/integration/targets/setup_tls/files/ca_certificate.pem deleted file mode 100644 index a438d9266e..0000000000 --- a/test/integration/targets/setup_tls/files/ca_certificate.pem +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDAjCCAeqgAwIBAgIJANguFROhaWocMA0GCSqGSIb3DQEBCwUAMDExIDAeBgNV -BAMMF1RMU0dlblNlbGZTaWduZWR0Um9vdENBMQ0wCwYDVQQHDAQkJCQkMB4XDTE5 -MDExMTA4MzMxNVoXDTI5MDEwODA4MzMxNVowMTEgMB4GA1UEAwwXVExTR2VuU2Vs -ZlNpZ25lZHRSb290Q0ExDTALBgNVBAcMBCQkJCQwggEiMA0GCSqGSIb3DQEBAQUA -A4IBDwAwggEKAoIBAQDqVt84czSxWnWW4Ng6hmKE3NarbLsycwtjrYBokV7Kk7Mp -7PrBbYF05FOgSdJLvL6grlRSQK2VPsXdLfEv5uFXX6gyd2WQwKCiGGf4UY4ZIl4l -JVpSDsBV2orR4pOIf1s1+iSwvcRQkX46SVjoKWbDUc4VLo1uy8UvavQI+DMioYyy -0K2MbRs7oG2rdKks8zisfT0ymKnrFTdVeUjIrg0sStaMnf9VVkcEeYkfNY0vWqdn -CV5wPfDBlnnxGMgqGdLSpzfyJ7qafFET+q+gOvjsEqzn7DvlPkmk86hIIWXKi3aM -A9swknL3rnagJL6GioWRpYUwKdRKmZxdyr4I2JTTAgMBAAGjHTAbMAwGA1UdEwQF -MAMBAf8wCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBCwUAA4IBAQACTpPBf5WSwZ7r -hrbPUN3qVh70HI0ZNK2jlK6b5fpSdw3JI/GQl0Kw3eGICLzwTByWvhD62U7IigL5 -0UWxWuEod310Y/qo/7OxRVPp5PH/0oNGoKHhEzas2ii0heQYGsHQUKGzYNNyVfjy -nqBFz5AcKf067LcXivYqod6JDQHqFq/5/hWlIsHHrZIeijqqtthPq39GlGAYO+AB -U66nzlH7YQgmfYfy6l7O4LsjXf/bz9rWvueO3NqCsmXV+FacDkOkwWA5Kf6rcgNL -3G+2HAVTRIXDnO4ShnK6aYMW+UklpYRlVYBBUOdwoNIp5gI+BlSc1IuF6PdLVt3q -VdjN1MjY ------END CERTIFICATE----- diff --git a/test/integration/targets/setup_tls/files/ca_key.pem b/test/integration/targets/setup_tls/files/ca_key.pem deleted file mode 100644 index 0a950eda06..0000000000 --- a/test/integration/targets/setup_tls/files/ca_key.pem +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDqVt84czSxWnWW -4Ng6hmKE3NarbLsycwtjrYBokV7Kk7Mp7PrBbYF05FOgSdJLvL6grlRSQK2VPsXd -LfEv5uFXX6gyd2WQwKCiGGf4UY4ZIl4lJVpSDsBV2orR4pOIf1s1+iSwvcRQkX46 -SVjoKWbDUc4VLo1uy8UvavQI+DMioYyy0K2MbRs7oG2rdKks8zisfT0ymKnrFTdV -eUjIrg0sStaMnf9VVkcEeYkfNY0vWqdnCV5wPfDBlnnxGMgqGdLSpzfyJ7qafFET -+q+gOvjsEqzn7DvlPkmk86hIIWXKi3aMA9swknL3rnagJL6GioWRpYUwKdRKmZxd -yr4I2JTTAgMBAAECggEBALpg9ZDUMCiOpc+mbNO/ZkP90M7u38Q0M+7HY8XHOPkt -l+XUkWueSMRLhSeLDzMlnwf1HyN8RZLaJkzP6XAL1VXEwuXAiIskaZ4Cg07Arp/W -8cHhf4CcMuUVuCtOZcC+ajD4Do5zn9vkm9yH0ap0o0LdoWa/a8WfU+luy0EHBsSW -6qqI+nqNFmISluVbfWt7t3zp273+8sir6YeHQu9G91/jzggv8rHmu4EHhi3cnU0K -vY6OPCGBL7nrg9Rv1LSFpH95TvlIM6/Cm0AjgW7m6XwWUTaI9p+GvKzrYUSLd9L/ -QxlmAwiu/sBTXLrsWyr8XEtj+lVGxQ6eFbf6E+lUm8ECgYEA+8Wgmhf3VsC3gvJz -w2jApEoOioD5iGOWGClGVURkfaBhFELr4XCTVMdBuCtxT7LYTMHTAlBqIbdWDjB4 -m/E417hLGogSDy7j0R0Mx75OOGEitxYUhe0VGDNoytgCNd2UnTMt42lp+9vAHZag -INhVDOnxRNdtNTf1yYkWUMEbh1sCgYEA7kZNJXPVYJtR78+km/Gcv64Umci7KUV+ -hYc7chR5xv3cXvXg5eojKa4G7CyMQTX7VnRa6CiQKdN73AbIAhS4Oy5UlCOKtmb8 -xnBiOAYwSpOfIeZhjq0RvEeZX0t6u7XsErBZ03rEPKXF2nNDo1x8byrlKPtlUzwJ -gb5yjmK/mekCgYEA1TWQAs5m4+2Bun+tbv7nnHkmhT4hktGays0xRYYMf6Jwc6MU -dC5MZg/zZI5Nf8uZhq7hDWWh6vmCA7QifxSxKWVlHIu8l2UDAhRSvVg4j2Aa8Obe -7GdQZNUsWhLBFHKXpuQvaRTc7q8yqxvicM4igDQg4EZ6sgW4vDm+TxapRF8CgYAz -n6mhPqpxRtWGxo8cdkmGwfmWpAXg2DykQ3teqQ8FTQUM0erLBWJe6mR3kONGUaLF -xWnYuMkbNsW0EwgMY17S+6O5gMXR5RhJChpNlxGpZrhoiNiEJ/0atMyG9/x8ZNrj -5a9ggU248hWe0bBK2YPgNgP2UBlQ4kYRBSkerkhi2QKBgF+tlpyqcU+0iY82qRS2 -wMf7oI2pWR8nX9LPAY/nnvwWvqwcAFJPMlSMTu8Ext6h7l9yu+7JGL6JWwsO57Lb -Gm/RxbuZ/kG/13+lSNmZiyHrhj6hZhkAMeFM34fpT4+DBXqSxZuvdrmwBc5B2jYg -F9Bv8gcmZlGhqONL23evr9Gu ------END PRIVATE KEY----- diff --git a/test/integration/targets/setup_tls/files/client_certificate.pem b/test/integration/targets/setup_tls/files/client_certificate.pem deleted file mode 100644 index 501d83897f..0000000000 --- a/test/integration/targets/setup_tls/files/client_certificate.pem +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDRjCCAi6gAwIBAgIBAjANBgkqhkiG9w0BAQsFADAxMSAwHgYDVQQDDBdUTFNH -ZW5TZWxmU2lnbmVkdFJvb3RDQTENMAsGA1UEBwwEJCQkJDAeFw0xOTAxMTEwODMz -MThaFw0yOTAxMDgwODMzMThaMC0xGjAYBgNVBAMMEWFuc2libGUudGxzLnRlc3Rz -MQ8wDQYDVQQKDAZjbGllbnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB -AQCoM+OQ3HCnCUAAz9KGGTwWB9hQbUfAZXm/stlb2/uOAp3rNwxAlCs/giymBHE6 -Iu6mrK006Vn+Z9ibqIrD2LuCOxcu25y8goqG62TgdP5sa9wR+597s0XssnwnaY8y -bJ3p2zWAJvMgqQ0iNW/ZynpWbO85K5SryUykF7FAeNU9ogGGlIwCPjHhPvnwjkqd -yDqaA1VaJKDUWIF9joI7sV4VLgGhQvzXRrHULsTeIF2m0+ebL0PTNEWHQ0dtgLYX -kW7YO4Y6+n3cjHNH4qTof8V30EK8pk8kTdJ/x6ubwf+klFCAyroOxNOaxUy299Oo -yD6qIPJPnGkPhrKtWnWIhNzJAgMBAAGjbTBrMAkGA1UdEwQCMAAwCwYDVR0PBAQD -AgWgMBMGA1UdJQQMMAoGCCsGAQUFBwMCMDwGA1UdEQQ1MDOCEWFuc2libGUudGxz -LnRlc3RzghNNYWNCb29rLVByby00LmxvY2Fsgglsb2NhbGhvc3QwDQYJKoZIhvcN -AQELBQADggEBAK214+VVXnGnsUlvd9Q6A2Ea6UGrr6b7xkmlnIaNd+6xoUsDsHob -srHYm7UC0uLi1KwSunI7AU5ZELVEUfAmJzh3O4d6C5sQyqKYPqd5harWOQ3BOD0I -plHpp7qMtsPDuJBtmE/bmvF85eto0H7pPz+cTTXRlOaVVeiHjMggFcXdy1MzGo9C -X/4wLQmsFeypTfe+ZGqvDh99VV+ffNMIsMh+opWEloaKiHmDKB6S9aC/MsVVM4RR -nHm/UKTOukaGE9QIPkSSaygv3sBkVnQ2SHMvvtnjPHVHlizNoq6+YTnuOvKpo4o5 -V7Bij+W7rkBQLsEfwv2IC+gzmRz2yxr2tXk= ------END CERTIFICATE----- diff --git a/test/integration/targets/setup_tls/files/client_key.pem b/test/integration/targets/setup_tls/files/client_key.pem deleted file mode 100644 index 850260a87f..0000000000 --- a/test/integration/targets/setup_tls/files/client_key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAqDPjkNxwpwlAAM/Shhk8FgfYUG1HwGV5v7LZW9v7jgKd6zcM -QJQrP4IspgRxOiLupqytNOlZ/mfYm6iKw9i7gjsXLtucvIKKhutk4HT+bGvcEfuf -e7NF7LJ8J2mPMmyd6ds1gCbzIKkNIjVv2cp6VmzvOSuUq8lMpBexQHjVPaIBhpSM -Aj4x4T758I5Kncg6mgNVWiSg1FiBfY6CO7FeFS4BoUL810ax1C7E3iBdptPnmy9D -0zRFh0NHbYC2F5Fu2DuGOvp93IxzR+Kk6H/Fd9BCvKZPJE3Sf8erm8H/pJRQgMq6 -DsTTmsVMtvfTqMg+qiDyT5xpD4ayrVp1iITcyQIDAQABAoIBAHPszzpXs4xr46Cr -mvyxB6hnX76OkpUXWwGz0fptcsI9K3mhRuB7PhNXNE53YVIgITreZ8G/0jZ0e+VM -E9dG2HS5JRE2ap/BmJfERJIuD+vJqrL6KMCondi0arz/E6I9GdjDK+xW69nmqRaa -nawM0KQgD//m+WAsLJYrfg5hORZwI2SHaahawnCp0QaMmz3bdDWKRacM3q0UFX46 -Ze6CaZkUn+e1rHsTMcZBvxQWIVzysFNXh150idIB/PxL5YfCQqTSAj1c/nxaxz6a -BvHFlpaYR3tvXXlexxfjglCwsGyckbvTyP1cBZqpv5oES+VKt2PrOve9Zyax+CYT -0uQf6cECgYEA09+46QHXLfWh6jiJYu9skC9UrLU5czfCNB6PrUtFcjPFMYjZDcw9 -inJmcuTPXmfplxc47YDfpwotU+szTJDF+R8kknnfw9zVr/sIwZ5wsFfUQl/56Svn -AIOVvHHvcvMX95XKGiuTsoCIJZNjJN3l3ztu/bRciuiVLyizglwIVrMCgYEAyzvK -PFlWilbp3GPJlnW7x1bUxe1ziLE/Um+ujZx96+fy34hJLFdNdNzpNUjoOf3IDTGq -6xl+vXcf12gimWMFcD3qNIGKHBDM9cIB2RDbb6YcqI8lOqopsmOyGmVLPkRpCoUK -72kacQwvw6M9xjmpiG3dN8lE881jDmZi+hyCnJMCgYEAoIQnQAhP8Jbeo2dP1q+T -bS0elnX532uH6xqYOW8EXwAPznZiEw0ANspzCWqGHHzXQMusKmtvhcq1CpXvWHt6 -MUHB4GMK/wVosxmZya5yq3bu7ZZu7JOBQCdwosMi6NB5AO7vnaIUFLFB9E3UWBLw -243YicdCMU8B7yeD0ChPfPcCgYA1dYHKBBn+g8Q6Y8lIGaoOUmnfsok8gJtOfPAm -ce6xmi7J29iboE9QmTeC+62Sa44u4ky6UNeE0QwAJnVLcb+hebfcneKNZWH0l1bT -GVsPcFuDfzvkxZP4R782sERtmaMj0EFDHpuE9xatWIhMVyigKX4SSZAorXML+6S3 -c75rnwKBgBR+WU934wS+DbwTLlUB2mJWqJMEbOH/CUwPC7+VN4h1h3/i455iAeiU -BizLS0SlD+MoSbC7URcZuquqGkmMlnJXoxF+NdxoWZK78tYNftryWoR87TloiVc/ -LhkxZxje4tgW/mTLqH3zKDoyyzDzG6Q6tAUN2ZTjJFEws7qF30Qe ------END RSA PRIVATE KEY----- diff --git a/test/integration/targets/setup_tls/files/server_certificate.pem b/test/integration/targets/setup_tls/files/server_certificate.pem deleted file mode 100644 index 4a0ebc6ec0..0000000000 --- a/test/integration/targets/setup_tls/files/server_certificate.pem +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDRjCCAi6gAwIBAgIBATANBgkqhkiG9w0BAQsFADAxMSAwHgYDVQQDDBdUTFNH -ZW5TZWxmU2lnbmVkdFJvb3RDQTENMAsGA1UEBwwEJCQkJDAeFw0xOTAxMTEwODMz -MTZaFw0yOTAxMDgwODMzMTZaMC0xGjAYBgNVBAMMEWFuc2libGUudGxzLnRlc3Rz -MQ8wDQYDVQQKDAZzZXJ2ZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB -AQDIwErHwAesRBfd9HiZkmB3VYh28c1QkE9I8nYyHJKX2ZBUhAzK+h80BkcTJJ94 -265qWyACH/wl54Xe/ofFUFrGa4vz0qz4UkL/KI0OGw28Y4qnKdorb9DumbiIPB+9 -I9TJT9vhtXTxBNlBTpv3ONHL8EzdV6ZmuvELU11H27oQ4xoUYhfXPXLMLK0sOnXZ -lt0BOMMd5fVpJVa8fvXiw3626a0aXCr4e/MWUsBFRnzrXfgoW+AjYoTjKKS2hLYo -8//MM05h7ROIXrNe990sf9C1G+fOThmOMszK9sjMhu2xHranRcz5aA0UTfyOjTs8 -9WexUYhC5VorYyRWtVZu2mDjAgMBAAGjbTBrMAkGA1UdEwQCMAAwCwYDVR0PBAQD -AgWgMBMGA1UdJQQMMAoGCCsGAQUFBwMBMDwGA1UdEQQ1MDOCEWFuc2libGUudGxz -LnRlc3RzghNNYWNCb29rLVByby00LmxvY2Fsgglsb2NhbGhvc3QwDQYJKoZIhvcN -AQELBQADggEBAFoPBeB6tQhFS1198sia5NDHDDrghDOIlE0QbaoA+MSKzsaIy8Mu -mNcM2ewYpT600XXTBxcqF6/vuKL9OEbvivtRYQu1YfkifN1jzREoWTieUkR5ytzt -8ATfFkgTWJmiRiOIb/fNgewvhd+aKxep0OGwDiSKKl1ab6F17Cp4iK8sDBWmnUb6 -0Wf7pfver1Gl0Gp8vRXGUuc8a7udA9a8mV70HJlLkMdMvR9U8Bqih0+iRaqNWXRZ -7Lc6v5LbzrW/ntilmgU6F0lwxPydg49MY4UrSXcjYLZs9T4iYHwTfLxFjFMIgGwn -peYMKRj18akP9i2mjj5O2mRu4K+ecuUSOGI= ------END CERTIFICATE----- diff --git a/test/integration/targets/setup_tls/files/server_key.pem b/test/integration/targets/setup_tls/files/server_key.pem deleted file mode 100644 index c79ab64804..0000000000 --- a/test/integration/targets/setup_tls/files/server_key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAyMBKx8AHrEQX3fR4mZJgd1WIdvHNUJBPSPJ2MhySl9mQVIQM -yvofNAZHEySfeNuualsgAh/8JeeF3v6HxVBaxmuL89Ks+FJC/yiNDhsNvGOKpyna -K2/Q7pm4iDwfvSPUyU/b4bV08QTZQU6b9zjRy/BM3VemZrrxC1NdR9u6EOMaFGIX -1z1yzCytLDp12ZbdATjDHeX1aSVWvH714sN+tumtGlwq+HvzFlLARUZ86134KFvg -I2KE4yiktoS2KPP/zDNOYe0TiF6zXvfdLH/QtRvnzk4ZjjLMyvbIzIbtsR62p0XM -+WgNFE38jo07PPVnsVGIQuVaK2MkVrVWbtpg4wIDAQABAoIBAHw3wA3pnNXTLJGC -fD1KfbZZjp9K76gyI10X6lsHow2i6dPiAah3LGecms4VkzfNdxcIW7303Kj3obZh -+ND277RnR6oPakgdXqdUCDP6OX2gemMFWqIWBkodhDmIOntmeHw4le4LwdiBD42B -frBy0B5JCsbLPYPDmPNRGh8krvVS+Eir4hb4tK95TPMSL0vEjvHYFbCxv7//Ri1p -3CROGp2CGX0WZ+Zs0crRNoIhRRM6kLAhROcqejtnEy6o7l5CWpCAL2vxlE9y8/kL -iRawSZRFZnz/zGnqpx0vswgvijkuPfcNGMSzdwaiDgQz8D0GkJ7s9VgzZJazNy+1 -ET/4YIECgYEA612rwP9Ar9qdYbmmMPaJzITnaIrNGfO2JvaQqZt+DG8sVgdxL7V5 -D6emcw406drKRZvFAxnW6ZW2bVpmit02osl0re2A/nOTXLNuo338Qkap/hG8YZrF -bw7w75pFa/rwlDtedjBnGHO2KbRXeU5Hn5wLoKjYgJoF6Ht+PPdL0IsCgYEA2lnC -pQEhM51iRMDqNdmVJyvsTNU1ikoO8HaXHq+LwOQETaKMnDwp4Bn14E815CTulAc/ -tsDTKSDk6umZ+IufG1a2v7CqgKVwkB4HkgxKFQs2gQdTFfoMi5eeHR+njuNtklp1 -9fWfKHsP/ddrg+iTVTRZBLWexgKK89IMHYalpAkCgYEAy0Q3a9NF81mTJ+3kOE8C -zO1OyLtuzGXsvxOb9c6C+owctyNwPeq05a89EgqH6hr5K0qOx9HOCCcyyJgVDQJl -CAuByB/gkmAQOTQBbhMFA9vxPanljknTDsnRjKwoHkw2712ig+Hjd3ufK79C+FGB -i7eBVzva1p2uUowshsxv3mcCgYAOFiRciMofjlO8o8V4W+Undcn02vxtQ4HbOYte -S2z0sMEmUQpJOghpkMMwCWwsn8VUf3M40w/MY3bhQNjSFA/br6hyjW8yhXnRkl5i -qbBN0z9c66AMlukgSFPHBTfGHB4Bhxx9Fa+C6Q2LDs6839BBevMTPrRTie509GQb -s4gUIQKBgAvE8wLcmozno0GLDnBdKRZP/C7tmVnAINuraITPUBTASwI+Qo8ILigQ -LRLaDqF84BEpjb8vdzkYFQqRQSZ8BI8NydfuKEFSBfL27sBvSGMYQJVm6bryUmPq -T3ayaeZ4Wb3FFDijgtM9dRKyf7p4hQPOqM44QrntAtb43b2Q5L7M ------END RSA PRIVATE KEY----- diff --git a/test/integration/targets/setup_tls/tasks/main.yml b/test/integration/targets/setup_tls/tasks/main.yml deleted file mode 100644 index c5b7a23a22..0000000000 --- a/test/integration/targets/setup_tls/tasks/main.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -# Generated certificate with: https://github.com/michaelklishin/tls-gen -# ~/tls-gen/basic# make PASSWORD=bunnies CN=ansible.tls.tests -# verify with: make info - -- name: ensure target directory is present - file: - path: /tls - state: directory - -- name: ensure TLS files are present - copy: - src: "{{ item }}" - dest: "/tls/{{ item }}" - loop: - - ca_certificate.pem - - ca_key.pem - - client_certificate.pem - - client_key.pem - - server_certificate.pem - - server_key.pem diff --git a/test/integration/targets/setup_wildfly_server/defaults/main.yml b/test/integration/targets/setup_wildfly_server/defaults/main.yml deleted file mode 100644 index 64019a04b3..0000000000 --- a/test/integration/targets/setup_wildfly_server/defaults/main.yml +++ /dev/null @@ -1,8 +0,0 @@ -wf_tmp_dir: '{{ remote_tmp_dir }}/wildfly_tmp' -wf_homedir: '{{ wf_tmp_dir }}/wildfly' -wf_service_file_path: /etc/systemd/system/wildfly.service -wf_version: 16.0.0.Final -wf_user: wildfly -jboss_root: '{{ wf_homedir }}' -deploy_dir: '{{ jboss_root }}/standalone/deployments' -default_deploy_root: /var/lib/jbossas/standalone/deployments diff --git a/test/integration/targets/setup_wildfly_server/files/wildfly.conf b/test/integration/targets/setup_wildfly_server/files/wildfly.conf deleted file mode 100644 index 4ff3293b72..0000000000 --- a/test/integration/targets/setup_wildfly_server/files/wildfly.conf +++ /dev/null @@ -1,8 +0,0 @@ -# The configuration you want to run -WILDFLY_CONFIG=standalone.xml - -# The mode you want to run -WILDFLY_MODE=standalone - -# The address to bind to -WILDFLY_BIND=0.0.0.0 diff --git a/test/integration/targets/setup_wildfly_server/handlers/main.yml b/test/integration/targets/setup_wildfly_server/handlers/main.yml deleted file mode 100644 index 98db569dba..0000000000 --- a/test/integration/targets/setup_wildfly_server/handlers/main.yml +++ /dev/null @@ -1,13 +0,0 @@ -- name: Stop wildfly (jboss) - systemd: - name: wildfly - state: stopped - ignore_errors: yes - -- name: Remove files - file: - path: '{{ item }}' - state: absent - loop: - - '{{ wf_service_file_path }}' - - '{{ default_deploy_root }}' diff --git a/test/integration/targets/setup_wildfly_server/meta/main.yml b/test/integration/targets/setup_wildfly_server/meta/main.yml deleted file mode 100644 index 9f37e96cd9..0000000000 --- a/test/integration/targets/setup_wildfly_server/meta/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: -- setup_remote_tmp_dir diff --git a/test/integration/targets/setup_wildfly_server/tasks/main.yml b/test/integration/targets/setup_wildfly_server/tasks/main.yml deleted file mode 100644 index 507c39b1f1..0000000000 --- a/test/integration/targets/setup_wildfly_server/tasks/main.yml +++ /dev/null @@ -1,94 +0,0 @@ -- name: Skip unsupported platforms - meta: end_play - when: (ansible_distribution != 'CentOS') or - (ansible_distribution == 'CentOS' and ansible_distribution_major_version is not version('7', '>=')) - -- name: Install java - package: - name: java-1.8.0-openjdk-devel - -- name: Create wf_tmp_dir - file: - path: '{{ wf_tmp_dir }}' - state: directory - -- name: Download wildfly - get_url: - url: 'https://ansible-ci-files.s3.amazonaws.com/test/integration/targets/setup_wildfly_server/wildfly-{{ wf_version }}.tar.gz' - dest: '{{ wf_tmp_dir }}/wildfly-{{ wf_version }}.tar.gz' - -- name: Unarchive tar - unarchive: - src: '{{ wf_tmp_dir }}/wildfly-{{ wf_version }}.tar.gz' - dest: '{{ wf_tmp_dir }}' - remote_src: yes - -- name: Remove tar - file: - path: '{{ wf_tmp_dir }}/wildfly-{{ wf_version }}.tar.gz' - state: absent - -- name: Create symlink - file: - src: '{{ wf_tmp_dir }}/wildfly-{{ wf_version }}' - dest: '{{ wf_tmp_dir }}/wildfly' - state: link - -- name: Create group for wildfly - group: - name: '{{ wf_user }}' - system: yes - -- name: Create user for wildfly - user: - name: '{{ wf_user }}' - system: yes - group: '{{ wf_user }}' - home: '{{ wf_homedir }}' - -- name: Set permissions - file: - path: '{{ remote_tmp_dir }}' - state: directory - owner: '{{ wf_user }}' - group: '{{ wf_user }}' - recurse: yes - -- name: Create config file - copy: - src: wildfly.conf - dest: '{{ wf_homedir }}/wildfly.conf' - -- name: Create launcher - template: - src: launch.sh.j2 - dest: '{{ wf_homedir }}/bin/launch.sh' - -- name: Make scripts executable - shell: 'chmod +x {{ wf_homedir }}/bin/*.sh' - -- name: Create service file - template: - src: wildfly.service.j2 - dest: '{{ wf_service_file_path }}' - -- name: Create directories for testing the default deploy_path - become: yes - file: - path: '{{ default_deploy_root }}' - state: directory - recurse: yes - owner: '{{ wf_user }}' - group: '{{ wf_user }}' - -- name: Create simlink for testing the default deploy_path - file: - state: link - src: '{{ deploy_dir }}' - dest: '{{ default_deploy_root }}/deployments' - -- name: Reload systemd and start wildfly - systemd: - daemon_reload: yes - name: wildfly - state: started diff --git a/test/integration/targets/setup_wildfly_server/templates/launch.sh.j2 b/test/integration/targets/setup_wildfly_server/templates/launch.sh.j2 deleted file mode 100644 index a01bcc513e..0000000000 --- a/test/integration/targets/setup_wildfly_server/templates/launch.sh.j2 +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -if [ "x$WILDFLY_HOME" = "x" ]; then - WILDFLY_HOME="{{ wf_homedir }}" -fi - -if [[ "$1" == "domain" ]]; then - $WILDFLY_HOME/bin/domain.sh -c "$2" -b "$3" -else - $WILDFLY_HOME/bin/standalone.sh -c "$2" -b "$3" -fi diff --git a/test/integration/targets/setup_wildfly_server/templates/wildfly.service.j2 b/test/integration/targets/setup_wildfly_server/templates/wildfly.service.j2 deleted file mode 100644 index 686c30193e..0000000000 --- a/test/integration/targets/setup_wildfly_server/templates/wildfly.service.j2 +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=The WildFly Application Server -After=syslog.target network.target -Before=httpd.service - -[Service] -Environment=LAUNCH_JBOSS_IN_BACKGROUND=1 -EnvironmentFile=-{{ wf_homedir }}/wildfly.conf -User=wildfly -LimitNOFILE=102642 -PIDFile=/var/run/wildfly/wildfly.pid -ExecStart={{ wf_homedir }}/bin/launch.sh $WILDFLY_MODE $WILDFLY_CONFIG $WILDFLY_BIND -StandardOutput=null - -[Install] -WantedBy=multi-user.target diff --git a/test/integration/targets/setup_win_device/handlers/main.yml b/test/integration/targets/setup_win_device/handlers/main.yml deleted file mode 100644 index 5c01331ad7..0000000000 --- a/test/integration/targets/setup_win_device/handlers/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: remove dummy network adapter device - win_device: - name: '{{ network_device_name_raw.name }}' - state: absent diff --git a/test/integration/targets/setup_win_device/library/win_device.ps1 b/test/integration/targets/setup_win_device/library/win_device.ps1 deleted file mode 100644 index e95d4c818c..0000000000 --- a/test/integration/targets/setup_win_device/library/win_device.ps1 +++ /dev/null @@ -1,542 +0,0 @@ -#!powershell - -#AnsibleRequires -CSharpUtil Ansible.Basic -#Requires -Module Ansible.ModuleUtils.AddType - -$spec = @{ - options = @{ - hardware_id = @{ type = "str" } - name = @{ type = "str" } - path = @{ type = "path" } - state = @{ type = "str"; choices = @("absent", "present"); default = "present" } - } - required_if = @( - @("state", "present", @("path", "hardware_id"), $true), - @("state", "absent", @(,"name")) - ) - supports_check_mode = $true -} - -$module = [Ansible.Basic.AnsibleModule]::Create($args, $spec) - -$hardware_id = $module.Params.hardware_id -$name = $module.Params.name -$path = $module.Params.path -$state = $module.Params.state - -$module.Result.reboot_required = $false - -Add-CSharpType -References @' -using Microsoft.Win32.SafeHandles; -using System; -using System.ComponentModel; -using System.Runtime.ConstrainedExecution; -using System.Runtime.InteropServices; -using System.Text; - -namespace Ansible.Device -{ - public class NativeHelpers - { - [StructLayout(LayoutKind.Sequential)] - public class SP_DEVINFO_DATA - { - public UInt32 cbSize; - public Guid ClassGuid; - public UInt32 DevInst; - public IntPtr Reserved; - - public SP_DEVINFO_DATA() - { - this.cbSize = (UInt32)Marshal.SizeOf(this); - this.ClassGuid = Guid.Empty; - } - } - - [Flags] - public enum DeviceInfoCreationFlags : uint - { - DICD_GENERATE_ID = 0x00000001, - DICD_INHERIT_CLASSDRVS = 0x00000002, - } - - public enum DeviceProperty : uint - { - SPDRP_DEVICEDESC = 0x0000000, - SPDRP_HARDWAREID = 0x0000001, - SPDRP_COMPATIBLEIDS = 0x0000002, - SPDRP_UNUSED0 = 0x0000003, - SPDRP_SERVICE = 0x0000004, - SPDRP_UNUSED1 = 0x0000005, - SPDRP_UNUSED2 = 0x0000006, - SPDRP_CLASS = 0x0000007, // Read only - tied to ClassGUID - SPDRP_CLASSGUID = 0x0000008, - SPDRP_DRIVER = 0x0000009, - SPDRP_CONFIGFLAGS = 0x000000a, - SPDRP_MFG = 0x000000b, - SPDRP_FRIENDLYNAME = 0x000000c, - SPDRP_LOCATION_INFORMATION = 0x000000d, - SPDRP_PHYSICAL_DEVICE_OBJECT_NAME = 0x000000e, // Read only - SPDRP_CAPABILITIES = 0x000000f, // Read only - SPDRP_UI_NUMBER = 0x0000010, // Read only - SPDRP_UPPERFILTERS = 0x0000011, - SPDRP_LOWERFILTERS = 0x0000012, - SPDRP_BUSTYPEGUID = 0x0000013, // Read only - SPDRP_LEGACYBUSTYPE = 0x0000014, // Read only - SPDRP_BUSNUMBER = 0x0000015, // Read only - SPDRP_ENUMERATOR_NAME = 0x0000016, // Read only - SPDRP_SECURITY = 0x0000017, - SPDRP_SECURITY_SDS = 0x0000018, - SPDRP_DEVTYPE = 0x0000019, - SPDRP_EXCLUSIVE = 0x000001a, - SPDRP_CHARACTERISTICS = 0x000001b, - SPDRP_ADDRESS = 0x000001c, // Read only - SPDRP_UI_NUMBER_DESC_FORMAT = 0x000001d, - SPDRP_DEVICE_POWER_DATA = 0x000001e, // Read only - SPDRP_REMOVAL_POLICY = 0x000001f, // Read only - SPDRP_REMOVAL_POLICY_HW_DEFAULT = 0x0000020, // Read only - SPDRP_REMOVAL_POLICY_OVERRIDE = 0x0000021, - SPDRP_INSTALL_STATE = 0x0000022, // Read only - SPDRP_LOCATION_PATHS = 0x0000023, // Read only - SPDRP_BASE_CONTAINERID = 0x0000024, // Read only - } - - // https://docs.microsoft.com/en-us/previous-versions/ff549793%28v%3dvs.85%29 - public enum DifCodes : uint - { - DIF_SELECTDIVE = 0x00000001, - DIF_INSTALLDEVICE = 0x00000002, - DIF_ASSIGNRESOURCES = 0x00000003, - DIF_PROPERTIES = 0x00000004, - DIF_REMOVE = 0x00000005, - DIF_FIRSTTIMESETUP = 0x00000006, - DIF_FOUNDDEVICE = 0x00000007, - DIF_SELECTCLASSDRIVERS = 0x00000008, - DIF_VALIDATECLASSDRIVERS = 0x00000009, - DIF_INSTALLCLASSDRIVERS = 0x0000000a, - DIF_CALCDISKSPACE = 0x0000000b, - DIF_DESTROYPRIVATEDATA = 0x0000000c, - DIF_VALIDATEDRIVER = 0x0000000d, - DIF_DETECT = 0x0000000f, - DIF_INSTALLWIZARD = 0x00000010, - DIF_DESTROYWIZARDDATA = 0x00000011, - DIF_PROPERTYCHANGE = 0x00000012, - DIF_ENABLECLASS = 0x00000013, - DIF_DETECTVERIFY = 0x00000014, - DIF_INSTALLDEVICEFILES = 0x00000015, - DIF_UNREMOVE = 0x00000016, - DIF_SELECTBESTCOMPATDRV = 0x00000017, - DIF_ALLOW_INSTALL = 0x00000018, - DIF_REGISTERDEVICE = 0x00000019, - DIF_NEWDEVICEWIZARD_PRESELECT = 0x0000001a, - DIF_NEWDEVICEWIZARD_SELECT = 0x0000001b, - DIF_NEWDEVICEWIZARD_PREANALYZE = 0x0000001c, - DIF_NEWDEVICEWIZARD_POSTANALYZE = 0x0000001d, - DIF_NEWDEVICEWIZARD_FINISHINSTALL = 0x0000001e, - DIF_UNUSED1 = 0x0000001e, - DIF_INSTALLINTERFACES = 0x00000020, - DIF_DETECTCANCEL = 0x00000021, - DIF_REGISTER_COINSTALLERS = 0x00000022, - DIF_ADDPROPERTYPAGE_ADVANCED = 0x00000023, - DIF_ADDPROPERTYPAGE_BASIC = 0x00000024, - DIF_RESERVED1 = 0x00000025, - DIF_TROUBLESHOOTER = 0x00000026, - DIF_POWERMESSAGEWAKE = 0x00000027, - DIF_ADDREMOTEPROPERTYPAGE_ADVANCED = 0x00000028, - DIF_UPDATEDRIVER_UI = 0x00000029, - DIF_FINISHINSTALL_ACTION = 0x0000002a, - } - - [Flags] - public enum GetClassFlags : uint - { - DIGCF_DEFAULT = 0x00000001, - DIGCF_PRESENT = 0x00000002, - DIGCF_ALLCLASSES = 0x00000004, - DIGCF_PROFILE = 0x00000008, - DIGCF_DEVICEINTERFACE = 0x00000010, - } - - [Flags] - public enum InstallFlags : uint - { - INSTALLFLAG_FORCE = 0x00000001, - INSTALLFLAG_READONLY = 0x00000002, - INSTALLFLAG_NONINTERACTIVE = 0x00000004, - INSTALLFLAG_BITS = 0x00000007, - } - } - - public class NativeMethods - { - [DllImport("Setupapi.dll", SetLastError = true)] - public static extern bool SetupDiCallClassInstaller( - NativeHelpers.DifCodes InstallFunction, - SafeDeviceInfoSet DeviceInfoSet, - NativeHelpers.SP_DEVINFO_DATA DeviceInfoData); - - [DllImport("Setupapi.dll", SetLastError = true)] - public static extern SafeDeviceInfoSet SetupDiCreateDeviceInfoList( - Guid ClassGuid, - IntPtr hwndParent); - - [DllImport("Setupapi.dll", SetLastError = true)] - public static extern bool SetupDiCreateDeviceInfoW( - SafeDeviceInfoSet DeviceInfoSet, - [MarshalAs(UnmanagedType.LPWStr)] string DeviceName, - Guid ClassGuid, - [MarshalAs(UnmanagedType.LPWStr)] string DeviceDescription, - IntPtr hwndParent, - NativeHelpers.DeviceInfoCreationFlags CreationFlags, - NativeHelpers.SP_DEVINFO_DATA DeviceInfoData); - - [DllImport("Setupapi.dll", SetLastError = true)] - public static extern bool SetupDiDestroyDeviceInfoList( - IntPtr DeviceInfoSet); - - [DllImport("Setupapi.dll", SetLastError = true)] - public static extern bool SetupDiEnumDeviceInfo( - SafeDeviceInfoSet DeviceInfoSet, - UInt32 MemberIndex, - NativeHelpers.SP_DEVINFO_DATA DeviceInfoData); - - [DllImport("Setupapi.dll", SetLastError = true)] - public static extern SafeDeviceInfoSet SetupDiGetClassDevsW( - Guid ClassGuid, - [MarshalAs(UnmanagedType.LPWStr)] string Enumerator, - IntPtr hwndParent, - NativeHelpers.GetClassFlags Flags); - - [DllImport("Setupapi.dll", SetLastError = true)] - public static extern bool SetupDiGetDeviceRegistryPropertyW( - SafeDeviceInfoSet DeviceInfoSet, - NativeHelpers.SP_DEVINFO_DATA DeviceInfoData, - NativeHelpers.DeviceProperty Property, - out UInt32 PropertyRegDataType, - SafeMemoryBuffer PropertyBuffer, - UInt32 PropertyBufferSize, - ref UInt32 RequiredSize); - - [DllImport("Setupapi.dll", SetLastError = true)] - public static extern bool SetupDiGetINFClassW( - [MarshalAs(UnmanagedType.LPWStr)] string InfName, - ref Guid ClassGuid, - [MarshalAs(UnmanagedType.LPWStr)] StringBuilder ClassName, - UInt32 ClassNameSize, - ref UInt32 RequiredSize); - - [DllImport("Setupapi.dll", SetLastError = true)] - public static extern bool SetupDiSetDeviceRegistryPropertyW( - SafeDeviceInfoSet DeviceInfoSet, - NativeHelpers.SP_DEVINFO_DATA DeviceInfoData, - NativeHelpers.DeviceProperty Property, - SafeMemoryBuffer PropertyBuffer, - UInt32 PropertyBufferSize); - - [DllImport("Newdev.dll", SetLastError = true)] - public static extern bool UpdateDriverForPlugAndPlayDevicesW( - IntPtr hwndParent, - [MarshalAs(UnmanagedType.LPWStr)] string HardwareId, - [MarshalAs(UnmanagedType.LPWStr)] string FullInfPath, - NativeHelpers.InstallFlags InstallFlags, - ref bool bRebootRequired); - } - - public class SafeDeviceInfoSet : SafeHandleZeroOrMinusOneIsInvalid - { - public SafeDeviceInfoSet() : base(true) { } - - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - protected override bool ReleaseHandle() - { - return NativeMethods.SetupDiDestroyDeviceInfoList(handle); - } - } - - public class SafeMemoryBuffer : SafeHandleZeroOrMinusOneIsInvalid - { - public int Length = 0; - - public SafeMemoryBuffer() : base(true) { } - - public SafeMemoryBuffer(int cb) : base(true) - { - Length = cb; - base.SetHandle(Marshal.AllocHGlobal(cb)); - } - - public SafeMemoryBuffer(string sz) : base(true) - { - Length = sz.Length * sizeof(char); - base.SetHandle(Marshal.StringToHGlobalUni(sz)); - } - - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - protected override bool ReleaseHandle() - { - Marshal.FreeHGlobal(handle); - return true; - } - } - - public class DeviceUtil - { - public static string GetDeviceFriendlyName(SafeDeviceInfoSet devInfoSet, NativeHelpers.SP_DEVINFO_DATA devInfo) - { - string friendlyName = GetDeviceStringProp(devInfoSet, devInfo, NativeHelpers.DeviceProperty.SPDRP_FRIENDLYNAME); - - // Older Windows versions may not have a friendly name set. This seems to be the case when the device has - // a unique description so we fallback to that value. - if (null == friendlyName) - friendlyName = GetDeviceStringProp(devInfoSet, devInfo, NativeHelpers.DeviceProperty.SPDRP_DEVICEDESC); - - return friendlyName; - } - - public static void SetDeviceHardwareId(SafeDeviceInfoSet devInfoSet, NativeHelpers.SP_DEVINFO_DATA devInfo, - string hardwareId) - { - SetDeviceStringProp(devInfoSet, devInfo, NativeHelpers.DeviceProperty.SPDRP_HARDWAREID, hardwareId); - } - - private static string GetDeviceStringProp(SafeDeviceInfoSet devInfoSet, NativeHelpers.SP_DEVINFO_DATA devInfo, - NativeHelpers.DeviceProperty property) - { - using (SafeMemoryBuffer memBuf = GetDeviceProperty(devInfoSet, devInfo, property)) - { - if (memBuf.IsInvalid) // Property does not exist so just return null. - return null; - - return Marshal.PtrToStringUni(memBuf.DangerousGetHandle()); - } - } - - private static SafeMemoryBuffer GetDeviceProperty(SafeDeviceInfoSet devInfoSet, - NativeHelpers.SP_DEVINFO_DATA devInfo, NativeHelpers.DeviceProperty property) - { - UInt32 requiredSize = 0; - UInt32 regDataType = 0; - if (!NativeMethods.SetupDiGetDeviceRegistryPropertyW(devInfoSet, devInfo, property, - out regDataType, new SafeMemoryBuffer(0), 0, ref requiredSize)) - { - int errCode = Marshal.GetLastWin32Error(); - if (errCode == 0x0000000D) // ERROR_INVALID_DATA - return new SafeMemoryBuffer(); // The FRIENDLYNAME property does not exist - else if (errCode != 0x0000007A) // ERROR_INSUFFICIENT_BUFFER - throw new Win32Exception(errCode); - } - - SafeMemoryBuffer memBuf = new SafeMemoryBuffer((int)requiredSize); - if (!NativeMethods.SetupDiGetDeviceRegistryPropertyW(devInfoSet, devInfo, property, - out regDataType, memBuf, requiredSize, ref requiredSize)) - { - int errCode = Marshal.GetLastWin32Error(); - memBuf.Dispose(); - - throw new Win32Exception(errCode); - } - - return memBuf; - } - - private static void SetDeviceStringProp(SafeDeviceInfoSet devInfoSet, NativeHelpers.SP_DEVINFO_DATA devInfo, - NativeHelpers.DeviceProperty property, string value) - { - using (SafeMemoryBuffer buffer = new SafeMemoryBuffer(value)) - SetDeviceProperty(devInfoSet, devInfo, property, buffer); - } - - private static void SetDeviceProperty(SafeDeviceInfoSet devInfoSet, NativeHelpers.SP_DEVINFO_DATA devInfo, - NativeHelpers.DeviceProperty property, SafeMemoryBuffer buffer) - { - if (!NativeMethods.SetupDiSetDeviceRegistryPropertyW(devInfoSet, devInfo, property, buffer, - (UInt32)buffer.Length)) - { - throw new Win32Exception(Marshal.GetLastWin32Error()); - } - } - } -} -'@ - -Function Get-Win32ErrorMessage { - Param ([System.Int32]$ErrorCode) - - $exp = New-Object -TypeName System.ComponentModel.Win32Exception -ArgumentList $ErrorCode - return ("{0} (Win32 ErrorCode {1} - 0x{1:X8}" -f $exp.Message, $ErrorCode) -} - -# Determine if the device is already installed -$dev_info_set = [Ansible.Device.NativeMethods]::SetupDiGetClassDevsW( - [Guid]::Empty, - [NullString]::Value, - [System.IntPtr]::Zero, - [Ansible.Device.NativeHelpers+GetClassFlags]::DIGCF_ALLCLASSES -); $err = [System.Runtime.InteropServices.Marshal]::GetLastWin32Error() - -try { - if ($dev_info_set.IsInvalid) { - $msg = Get-Win32ErrorMessage -ErrorCode $err - $module.FailJson("Failed to get device information set for installed devices: $msg") - } - - $dev_info = $null - if ($null -ne $name) { - # Loop through the set of all devices and compare the name - $idx = 0 - while ($true) { - $dev_info = New-Object -TypeName Ansible.Device.NativeHelpers+SP_DEVINFO_DATA - $res = [Ansible.Device.NativeMethods]::SetupDiEnumDeviceInfo( - $dev_info_set, - $idx, - $dev_info - ); $err = [System.Runtime.InteropServices.Marshal]::GetLastWin32Error() - - if (-not $res) { - $dev_info = $null - if ($err -eq 0x00000103) { # ERROR_NO_MORE_ITEMS - break - } - - $msg = Get-Win32ErrorMessage -ErrorCode $err - $module.FailJson("Failed to enumerate device information set at index $($idx): $msg") - } - - $device_name = [Ansible.Device.DeviceUtil]::GetDeviceFriendlyName($dev_info_set, $dev_info) - if ($device_name -eq $name) { - break - } - - $dev_info = $null - $idx++ - } - } - - if ($state -eq "absent" -and $null -ne $dev_info) { - if (-not $module.CheckMode) { - $res = [Ansible.Device.NativeMethods]::SetupDiCallClassInstaller( - [Ansible.Device.NativeHelpers+DifCodes]::DIF_REMOVE, - $dev_info_set, - $dev_info - ); $err = [System.Runtime.InteropServices.Marshal]::GetLastWin32Error() - - if (-not $res) { - $msg = Get-Win32ErrorMessage -ErrorCode $err - $module.FailJson("Failed to remove device $($name): $msg") - } - } - - $module.Result.changed = $true - } elseif ($state -eq "present" -and $null -eq $dev_info) { - # Populate the class guid and display name if the path to an inf file was set. - $class_id = [Guid]::Empty - $class_name = $null - if ($path) { - if (-not (Test-Path -LiteralPath $path)) { - $module.FailJson("Could not find the inf file specified at '$path'") - } - - $class_name_sb = New-Object -TypeName System.Text.StringBuilder -ArgumentList 32 # MAX_CLASS_NAME_LEN - $required_size = 0 - $res = [Ansible.Device.NativeMethods]::SetupDiGetINFClassW( - $path, - [ref]$class_id, - $class_name_sb, - $class_name_sb.Capacity, - [ref]$required_size - ); $err = [System.Runtime.InteropServices.Marshal]::GetLastWin32Error() - - if (-not $res) { - $msg = Get-Win32ErrorMessage -ErrorCode $err - $module.FailJson("Failed to parse driver inf at '$path': $msg") - } - - $class_name = $class_name_sb.ToString() - } - - # When creating a new device we want to start with a blank device information set. - $dev_info_set.Dispose() - - $dev_info_set = [Ansible.Device.NativeMethods]::SetupDiCreateDeviceInfoList( - $class_id, - [System.IntPtr]::Zero - ); $err = [System.Runtime.InteropServices.Marshal]::GetLastWin32Error() - - if ($dev_info_set.IsInvalid) { - $msg = Get-Win32ErrorMessage -ErrorCode $err - $module.FailJson("Failed to create device info set for the class $($class_id): $msg") - } - - # Create the new device element and add it to the device info set - $dev_info = New-Object -TypeName Ansible.Device.NativeHelpers+SP_DEVINFO_DATA - $res = [Ansible.Device.NativeMethods]::SetupDiCreateDeviceInfoW( - $dev_info_set, - $class_name, - $class_id, - $null, - [System.IntPtr]::Zero, - [Ansible.Device.NativeHelpers+DeviceInfoCreationFlags]::DICD_GENERATE_ID, - $dev_info - ); $err = [System.Runtime.InteropServices.Marshal]::GetLastWin32Error() - - if (-not $res) { - $msg = Get-Win32ErrorMessage -ErrorCode $err - $module.FailJson("Failed to create new device element for class $($class_name): $msg") - } - - # Set the hardware id of the new device so we can load the proper driver. - [Ansible.Device.DeviceUtil]::SetDeviceHardwareId($dev_info_set, $dev_info, $hardware_id) - - if (-not $module.CheckMode) { - # Install the device - $res = [Ansible.Device.NativeMethods]::SetupDiCallClassInstaller( - [Ansible.Device.NativeHelpers+DifCodes]::DIF_REGISTERDEVICE, - $dev_info_set, - $dev_info - ); $err = [System.Runtime.InteropServices.Marshal]::GetLastWin32Error() - - if (-not $res) { - $msg = Get-Win32ErrorMessage -ErrorCode $err - $module.FailJson("Failed to register new device for class $($class_name): $msg") - } - - # Load the drivers for the new device - $reboot_required = $false - $res = [Ansible.Device.NativeMethods]::UpdateDriverForPlugAndPlayDevicesW( - [System.IntPtr]::Zero, - $hardware_id, - $path, - [Ansible.Device.NativeHelpers+InstallFlags]'INSTALLFLAG_FORCE, INSTALLFLAG_NONINTERACTIVE', - [ref]$reboot_required - ); $err = [System.Runtime.InteropServices.Marshal]::GetLastWin32Error() - - if (-not $res) { - # On a failure make sure we cleanup the "installed" device - [Ansible.Device.NativeMethods]::SetupDiCallClassInstaller( - [Ansible.Device.NativeHelpers+DifCodes]::DIF_REMOVE, - $dev_info_set, - $dev_info - ) > $null - - $msg = Get-Win32ErrorMessage -ErrorCode $err - $module.FailJson("Failed to update device driver: $msg") - } - - $module.Result.reboot_required = $reboot_required - - # Now get the name of the newly created device which we return back to Ansible. - $name = [Ansible.Device.DeviceUtil]::GetDeviceFriendlyName($dev_info_set, $dev_info) - } else { - # Generate random name for check mode output - $name = "Check mode generated device for $($class_name)" - } - $module.Result.changed = $true - } -} finally { - $dev_info_set.Dispose() -} - -$module.Result.name = $name - -$module.ExitJson() - diff --git a/test/integration/targets/setup_win_device/tasks/main.yml b/test/integration/targets/setup_win_device/tasks/main.yml deleted file mode 100644 index cbbb98700b..0000000000 --- a/test/integration/targets/setup_win_device/tasks/main.yml +++ /dev/null @@ -1,22 +0,0 @@ -# Creates a network adapter device for testing purposes and registers the following vars -# network_device_name: The name of the network device -# network_adapter_name: The name of the network adapter ---- -- name: create dummy network adapter device - win_device: - path: '%WinDir%\Inf\netloop.inf' - hardware_id: '*msloop' - state: present - register: network_device_name_raw - notify: remove dummy network adapter device - -- set_fact: - network_device_name: '{{ network_device_name_raw.name }}' - -- name: get name of the dummy network adapter - win_shell: (Get-CimInstance -Class Win32_NetworkAdapter -Filter "Name='{{ network_device_name }}'").NetConnectionID - changed_when: False - register: network_adapter_name_raw - -- set_fact: - network_adapter_name: '{{ network_adapter_name_raw.stdout | trim }}' diff --git a/test/integration/targets/setup_win_psget/meta/main.yml b/test/integration/targets/setup_win_psget/meta/main.yml deleted file mode 100644 index 45806c8dc7..0000000000 --- a/test/integration/targets/setup_win_psget/meta/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: -- setup_remote_tmp_dir
\ No newline at end of file diff --git a/test/integration/targets/setup_win_psget/tasks/main.yml b/test/integration/targets/setup_win_psget/tasks/main.yml deleted file mode 100644 index 6c84b903c9..0000000000 --- a/test/integration/targets/setup_win_psget/tasks/main.yml +++ /dev/null @@ -1,87 +0,0 @@ -# Installs PackageManagement and PowerShellGet to the required versions for testing ---- -- name: check if PackageManagement has been installed - win_shell: if (Get-Command -Name Install-Module -ErrorAction SilentlyContinue) { $true } else { $false } - changed_when: False - register: module_installed - -- name: install PackageManagement and PowerShellGet - when: not module_installed.stdout | trim | bool - block: - - name: install PackageManagement - win_package: - path: https://ansible-ci-files.s3.amazonaws.com/test/integration/targets/setup_win_psget/PackageManagement_x64.msi - product_id: '{57E5A8BB-41EB-4F09-B332-B535C5954A28}' - state: present - - - name: create the required folder - win_file: - path: C:\Program Files\PackageManagement\ProviderAssemblies\nuget\2.8.5.208 - state: directory - - - name: download nuget provider dll - win_get_url: - url: https://ansible-ci-files.s3.amazonaws.com/test/integration/targets/setup_win_psget/Microsoft.PackageManagement.NuGetProvider-2.8.5.208.dll - dest: C:\Program Files\PackageManagement\ProviderAssemblies\nuget\2.8.5.208\Microsoft.PackageManagement.NuGetProvider.dll - -- name: get version and install location of PackageManagement and PowerShellGet - win_shell: | - $info = @{} - $modules = Get-Module -ListAvailable | Where-Object { - ($_.Name -eq "PackageManagement" -and $_.Version -lt "1.1.7") -or ($_.Name -eq "PowerShellGet" -and $_.Version -lt "1.6.0") - } | ForEach-Object { - $module_info = @{} - if ([System.IO.Path]::GetFileName($_.ModuleBase) -eq $_.Name) { - $module_info.remove_path = $_.ModuleBase - $module_info.install_path = $_.ModuleBase - } else { - $module_version = switch($_.Name) { - PackageManagement { "1.1.7.0" } - PowerShellGet { "1.6.0" } - } - $module_info.remove_path = "" - $module_info.install_path = ([System.IO.Path]::Combine([System.IO.Path]::GetDirectoryName($_.ModuleBase), $module_version)) - } - $info.($_.Name) = $module_info - } - - ConvertTo-Json -InputObject $info -Compress - changed_when: False - register: installed_modules - -- name: register installed_modules info - set_fact: - installed_modules: '{{ installed_modules.stdout | trim | from_json }}' - -- name: update the PackageManagement and PowerShellGet versions - when: installed_modules.keys() | list | length > 0 - block: - - name: download newer PackageManagement and PowerShellGet nupkg - win_get_url: - url: '{{ item.url }}' - dest: '{{ remote_tmp_dir }}\{{ item.name }}.zip' # .zip is required for win_unzip - when: item.name in installed_modules - loop: - - name: PackageManagement - url: https://ansible-ci-files.s3.amazonaws.com/test/integration/targets/setup_win_psget/packagemanagement.1.1.7.nupkg - - name: PowerShellGet - url: https://ansible-ci-files.s3.amazonaws.com/test/integration/targets/setup_win_psget/powershellget.1.6.0.nupkg - - - name: remove the old versions of PackageManagement and PowerShellGet - win_file: - path: '{{ item.value.remove_path }}' - state: absent - # This isn't necessary on 2016+ as packages are installed in a version specific dir - when: item.value.remove_path != "" - with_dict: '{{ installed_modules }}' - - - name: extract new modules to correct location - win_unzip: - src: '{{ remote_tmp_dir }}\{{ item.name }}.zip' - dest: '{{ item.path }}' - when: item.path != "" - loop: - - name: PackageManagement - path: '{{ installed_modules.PackageManagement.install_path | default("") }}' - - name: PowerShellGet - path: '{{ installed_modules.PowerShellGet.install_path | default("") }}' diff --git a/test/integration/targets/setup_zabbix/aliases b/test/integration/targets/setup_zabbix/aliases deleted file mode 100644 index 3d0091e7a9..0000000000 --- a/test/integration/targets/setup_zabbix/aliases +++ /dev/null @@ -1,5 +0,0 @@ -destructive -shippable/posix/group1 -skip/osx -skip/freebsd -skip/rhel diff --git a/test/integration/targets/setup_zabbix/defaults/main.yml b/test/integration/targets/setup_zabbix/defaults/main.yml deleted file mode 100644 index d6437a7568..0000000000 --- a/test/integration/targets/setup_zabbix/defaults/main.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -db_name: 'zabbix' -db_user: 'zabbix' -db_password: 'fLhijUs3PgekNhwJ' - -zabbix_version: 4.4 -zabbix_apt_repository: 'deb http://repo.zabbix.com/zabbix/{{ zabbix_version }}/{{ ansible_distribution.lower() }}/ {{ ansible_distribution_release }} main' -zabbix_apt_repository_key: 'http://repo.zabbix.com/zabbix-official-repo.key' - -zabbix_packages: - - zabbix-server-mysql - - zabbix-frontend-php - - zabbix-apache-conf diff --git a/test/integration/targets/setup_zabbix/handlers/main.yml b/test/integration/targets/setup_zabbix/handlers/main.yml deleted file mode 100644 index a39556215a..0000000000 --- a/test/integration/targets/setup_zabbix/handlers/main.yml +++ /dev/null @@ -1,15 +0,0 @@ -- name: remove zabbix repository - apt_repository: - repo: "{{ zabbix_apt_repository }}" - filename: zabbix - state: absent - -- name: remove zabbix packages - apt: - name: "{{ zabbix_packages }}" - state: absent - -- name: remove zabbix pip packages - pip: - name: zabbix-api - state: absent diff --git a/test/integration/targets/setup_zabbix/meta/main.yml b/test/integration/targets/setup_zabbix/meta/main.yml deleted file mode 100644 index 4aa170dc06..0000000000 --- a/test/integration/targets/setup_zabbix/meta/main.yml +++ /dev/null @@ -1,2 +0,0 @@ -dependencies: - - setup_mysql_db diff --git a/test/integration/targets/setup_zabbix/tasks/main.yml b/test/integration/targets/setup_zabbix/tasks/main.yml deleted file mode 100644 index 6d082fff21..0000000000 --- a/test/integration/targets/setup_zabbix/tasks/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- include: setup.yml - when: ansible_os_family == 'Debian' diff --git a/test/integration/targets/setup_zabbix/tasks/setup.yml b/test/integration/targets/setup_zabbix/tasks/setup.yml deleted file mode 100644 index 2af51f9431..0000000000 --- a/test/integration/targets/setup_zabbix/tasks/setup.yml +++ /dev/null @@ -1,89 +0,0 @@ -# sets up and starts Zabbix with default settings using a MySQL database. - -- name: install zabbix repository key - apt_key: - url: "{{ zabbix_apt_repository_key }}" - state: present - -- name: install zabbix repository - apt_repository: - repo: "{{ zabbix_apt_repository }}" - filename: zabbix - state: present - notify: remove zabbix repository - -- name: check if dpkg is set to exclude specific destinations - stat: - path: /etc/dpkg/dpkg.cfg.d/excludes - register: dpkg_excludes - -- name: ensure documentation installations are allowed for zabbix - lineinfile: - path: /etc/dpkg/dpkg.cfg.d/excludes - regexp: '^path-include=/usr/share/doc/zabbix*$' - line: 'path-include=/usr/share/doc/zabbix*' - state: present - when: dpkg_excludes.stat.exists - -- name: install zabbix apt dependencies - apt: - name: "{{ zabbix_packages }}" - state: latest - update_cache: yes - notify: remove zabbix packages - -- name: install zabbix-api python package - pip: - name: zabbix-api - state: latest - notify: remove zabbix pip packages - -- name: create mysql user {{ db_user }} - mysql_user: - name: "{{ db_user }}" - password: "{{ db_password }}" - state: present - priv: "{{ db_name }}.*:ALL" - login_unix_socket: '{{ mysql_socket }}' - -- name: import initial zabbix database - mysql_db: - name: "{{ db_name }}" - login_user: "{{ db_user }}" - login_password: "{{ db_password }}" - state: import - target: /usr/share/doc/zabbix-server-mysql/create.sql.gz - -- name: deploy zabbix-server configuration - template: - src: zabbix_server.conf.j2 - dest: /etc/zabbix/zabbix_server.conf - owner: root - group: zabbix - mode: 0640 - -- name: deploy zabbix web frontend configuration - template: - src: zabbix.conf.php.j2 - dest: /etc/zabbix/web/zabbix.conf.php - mode: 0644 - -- name: Create proper run directory for zabbix-server - file: - path: /var/run/zabbix - state: directory - owner: zabbix - group: zabbix - mode: 0775 - -- name: restart zabbix-server - service: - name: zabbix-server - state: restarted - enabled: yes - -- name: restart apache2 - service: - name: apache2 - state: restarted - enabled: yes diff --git a/test/integration/targets/setup_zabbix/templates/zabbix.conf.php.j2 b/test/integration/targets/setup_zabbix/templates/zabbix.conf.php.j2 deleted file mode 100644 index ad0a8328d2..0000000000 --- a/test/integration/targets/setup_zabbix/templates/zabbix.conf.php.j2 +++ /dev/null @@ -1,20 +0,0 @@ -<?php -// Zabbix GUI configuration file -global $DB; - -$DB['TYPE'] = 'MYSQL'; -$DB['SERVER'] = 'localhost'; -$DB['PORT'] = '0'; -$DB['DATABASE'] = '{{ db_name }}'; -$DB['USER'] = '{{ db_user }}'; -$DB['PASSWORD'] = '{{ db_password }}'; - -// SCHEMA is relevant only for IBM_DB2 database -$DB['SCHEMA'] = ''; - -$ZBX_SERVER = 'localhost'; -$ZBX_SERVER_PORT = '10051'; -$ZBX_SERVER_NAME = ''; - -$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG; -?> diff --git a/test/integration/targets/setup_zabbix/templates/zabbix_server.conf.j2 b/test/integration/targets/setup_zabbix/templates/zabbix_server.conf.j2 deleted file mode 100644 index f4c201af59..0000000000 --- a/test/integration/targets/setup_zabbix/templates/zabbix_server.conf.j2 +++ /dev/null @@ -1,7 +0,0 @@ -PidFile=/var/run/zabbix/zabbix_server.pid -LogFile=/tmp/zabbix_server.log -DBName={{ db_name }} -DBUser={{ db_user }} -DBPassword={{ db_password }} -Timeout=4 -LogSlowQueries=3000 |