Initial ansible onboard
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
*********************************
|
||||
Vagrant driver installation guide
|
||||
*********************************
|
||||
|
||||
Requirements
|
||||
============
|
||||
|
||||
* Vagrant
|
||||
* Virtualbox, Parallels, VMware Fusion, VMware Workstation or VMware Desktop
|
||||
|
||||
Install
|
||||
=======
|
||||
|
||||
Please refer to the `Virtual environment`_ documentation for installation best
|
||||
practices. If not using a virtual environment, please consider passing the
|
||||
widely recommended `'--user' flag`_ when invoking ``pip``.
|
||||
|
||||
.. _Virtual environment: https://virtualenv.pypa.io/en/latest/
|
||||
.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ pip install 'molecule_vagrant'
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: Update Package Cache (apt/Ubuntu)
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
update_cache: yes
|
||||
changed_when: false
|
||||
when: ansible_distribution == "Ubuntu"
|
||||
|
||||
- name: Update Package Cache (dnf/CentOS)
|
||||
become: true
|
||||
ansible.builtin.dnf:
|
||||
update_cache: yes
|
||||
changed_when: false
|
||||
when: ansible_distribution == "CentOS"
|
||||
|
||||
- name: Update Package Cache (yum/Amazon)
|
||||
become: true
|
||||
ansible.builtin.yum:
|
||||
update_cache: yes
|
||||
changed_when: false
|
||||
when: ansible_distribution == "Amazon"
|
||||
|
||||
- name: "Include microk8s"
|
||||
ansible.builtin.include_role:
|
||||
name: "microk8s"
|
||||
@@ -0,0 +1,50 @@
|
||||
---
|
||||
dependency:
|
||||
name: galaxy
|
||||
enabled: true
|
||||
driver:
|
||||
name: vagrant
|
||||
provider:
|
||||
name: libvirt
|
||||
provisioner:
|
||||
name: ansible
|
||||
config_options:
|
||||
defaults:
|
||||
callbacks_enabled: profile_tasks
|
||||
log: true
|
||||
inventory:
|
||||
group_vars: {}
|
||||
host_vars: {}
|
||||
platforms:
|
||||
- name: jammy
|
||||
box: "jaredeh/ubuntu2204-server"
|
||||
box_version: "0.1.1"
|
||||
interfaces:
|
||||
- auto_config: true
|
||||
network_name: private_network
|
||||
type: dhcp
|
||||
instance_raw_config_args:
|
||||
# use single quotes to avoid YAML parsing as dict due to ':'
|
||||
- 'vm.synced_folder ".", "/vagrant", type: "rsync"'
|
||||
# Run 'uname' a provisionning step **needs 'provision: true' to work**
|
||||
- 'vm.provision :shell, inline: "uname"'
|
||||
# Dictionary of `config` options. Note that string values need to be
|
||||
# explicitly enclosed in quotes.
|
||||
config_options:
|
||||
vm.boot_timeout: 600
|
||||
ssh.keep_alive: yes
|
||||
ssh.remote_user: 'ansible'
|
||||
synced_folder: true
|
||||
provider_options:
|
||||
video_type: 'vga'
|
||||
host: 'localhost'
|
||||
uri: 'qemu:///system'
|
||||
nested: true
|
||||
memory: 4096
|
||||
verifier:
|
||||
name: ansible
|
||||
lint: |
|
||||
set -e
|
||||
ansible-lint
|
||||
scenario:
|
||||
name: default
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
# This is an example playbook to execute Ansible tests.
|
||||
|
||||
- name: Verify
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Example assertion
|
||||
ansible.builtin.assert:
|
||||
that: true
|
||||
Reference in New Issue
Block a user