Debian Codegraph @

ansible_collections/theforeman/foreman/tests/test_playbooks/subnet_info.yml

raw symbols SCIP
1 ---
2 - hosts: localhost
3 collections:
4 - theforeman.foreman
5 gather_facts: false
6 vars_files:
7 - vars/server.yml
8 tasks:
9 - include_tasks: tasks/organization.yml
10 vars:
11 organization_state: present
12 - include_tasks: tasks/location.yml
13 vars:
14 location_organizations:
15 - "Test Organization"
16 location_state: present
17 - include_tasks: tasks/domain.yml
18 vars:
19 domain_name: "example.net"
20 domain_locations:
21 - "Test Location"
22 domain_organizations:
23 - "Test Organization"
24 domain_state: present
25 - name: create subnet
26 include_tasks: tasks/subnet.yml
27 vars:
28 subnet_name: "testnet"
29 subnet_organization:
30 - "Test Organization"
31 subnet_locations:
32 - "Test Location"
33 subnet_domains:
34 - "example.net"
35 subnet_cidr: 24
36
37 - hosts: tests
38 collections:
39 - theforeman.foreman
40 gather_facts: false
41 vars_files:
42 - vars/server.yml
43 tasks:
44 - name: fetch subnet info
45 subnet_info:
46 username: "{{ foreman_username }}"
47 password: "{{ foreman_password }}"
48 server_url: "{{ foreman_server_url }}"
49 validate_certs: "{{ foreman_validate_certs }}"
50 name: "testnet"
51 register: subnet_info
52 - name: check subnet details
53 assert:
54 that:
55 - subnet_info['subnet']['name'] == "testnet"
56 - subnet_info['subnet']['domains'][0]['name'] == "example.net"
57
58 - name: search subnet info
59 subnet_info:
60 username: "{{ foreman_username }}"
61 password: "{{ foreman_password }}"
62 server_url: "{{ foreman_server_url }}"
63 validate_certs: "{{ foreman_validate_certs }}"
64 search: "name = testnet"
65 register: subnet_info
66 - name: check subnet details
67 assert:
68 that:
69 - subnet_info['subnets'][0]['name'] == "testnet"
70
71 - hosts: localhost
72 collections:
73 - theforeman.foreman
74 gather_facts: false
75 vars_files:
76 - vars/server.yml
77 tasks:
78 - name: unassign domain from subnet
79 include_tasks: tasks/subnet.yml
80 vars:
81 subnet_name: "testnet"
82 subnet_cidr: 24
83 subnet_domains: []
84 - name: delete subnet
85 include_tasks: tasks/subnet.yml
86 vars:
87 subnet_name: "testnet"
88 subnet_state: absent
89 - include_tasks: tasks/domain.yml
90 vars:
91 domain_name: "example.net"
92 domain_state: absent
93 - include_tasks: tasks/location.yml
94 vars:
95 location_state: absent
96 - include_tasks: tasks/organization.yml
97 vars:
98 organization_state: absent
99 ...