-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvmdb2-ansible.yaml.example
27 lines (26 loc) · 1.09 KB
/
vmdb2-ansible.yaml.example
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
# Create a vmdb2-ansible.yaml file for it to be used by vmdb2
- hosts: image
gather_facts: no
tasks:
- name: test
ansible.builtin.raw:
echo test
# To begin, here is an example of a task installing python3 in the image, which is needed to run normal playbooks;
# we use "gather_facts: no" because facts gathering need python, which is not yet available:
# - name: Bootstrap a host without python3 installed
# gather_facts: no
# ansible.builtin.raw:
# apt install -y python3
# It is now possible to simply call any Ansible module, the shell module for example:
# - name: test
# ansible.builtin.shell: |
# echo test
# Or the apt module :
# - name: Install OpenSSH-Server
# ansible.builtin.apt:
# pkg: 'openssh-server'
# state: present
# The Ansible documentation for this can be found here (raw module):
# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/raw_module.html#synopsis
# and the specific need for "gather_facts: no" here:
# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/raw_module.html#notes