forked from agx/ansible_foreman_module
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.yml
38 lines (34 loc) · 861 Bytes
/
example.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
- hosts: localhost
tasks:
- name: Create a host in Foreman
foremanhost:
name: foobar
hostgroup: Medium/jenkins/blue
compute_resource: libvirt
state: present
image: Jessie
api_user: foreman
api_password: changeme
api_url: https://127.0.0.1
ssl_verify: False
register: result
- debug:
msg: Got "{{ result }}"
- name: Shutdown a host in Foreman
foremanhost:
state: poweredOff
name: foobar.example.com
register: shutdow_result
- assert:
that:
- shutdown_result.changed == false
- shutdown_result.power_state == 'poweredOff'
- name: Delete a host in Foreman
foremanhost:
name: foobar.example.com
state: absent
api_user: foreman
api_password: changeme
api_url: https://127.0.0.1
ssl_verify: False