Giter VIP home page Giter VIP logo

ansible_virtualization's Introduction

Ansible Virtualization Collection

Ansible Galaxy Collection: Virtualization:

  • KVM
  • VirtualBox
  • VMware Workstation
  • LXC/LXD
  • Docker-CE
  • Podman (with Buildah and Skopeo)
  • Packer
  • Vagrant
  • VM Tools (VMware, VirtualBox and KVM)
  • VMVagrant: setup a virtual machine for vagrant (user, ssh key, etc)

Tested on:

  • CentOS 7
  • RHEL 8
  • Fedora 30
  • Ubuntu 18.04
  • Debian 10

Example

Install the role:

pip install --upgrade ansible
ansible-galaxy collection install crivetimihai.virtualization

playbook.yml example

- name: setup a virtualization environment
  hosts: all
  connection: local
  become: yes
  gather_facts: yes
  roles:
    - role: crivetimihai.virtualization.kvm
    - role: crivetimihai.virtualization.lxd
    - role: crivetimihai.virtualization.vmware
    - role: crivetimihai.virtualization.virtualbox
    - role: crivetimihai.virtualization.podman
    - role: crivetimihai.virtualization.docker
    - role: crivetimihai.virtualization.packer
    - role: crivetimihai.virtualization.vagrant

Running the playbook

Change to the python interpreter location on the target system.

ansible-playbook -i localhost, playbook.yml \
  -e "vmware_workstation_license_key='XXXXX-XX...'" \
  -e "ansible_python_interpreter=/usr/bin/python3"

Running tests

molecule --debug create
molecule --debug converge
molecule login
molecule destroy

# Test one scenario:
molecule converge -s rhel-8

# Create a new role
molecule init role -r new_role -d docker

See also:

ansible_virtualization's People

Contributors

crivetimihai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ansible_virtualization's Issues

Vagrant role - rpm install fails

When I try to install vagrant 2.2.7 on RHEL 8.3 with ansible 2.9.16, the package install task fails with:

TASK [crivetimihai.virtualization.vagrant : install RedHat packages] *********************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to validate GPG signature for vagrant-1:2.2.7-1.x86_64"}

I believe this occurs because the RPM is not signed. Instead Hashicorp suggests validating the checksum. However, I did not experience this issue when installing on RHEL 8.0 with a slightly older version of ansible. I suppose it's possible a python module version changed, such as the one for dnf.

To work around this issue, I disabled the gpg check in my fork:

- name: install RedHat packages
  package:
    name: "{{ redhat_packages }}"
    state: present
    disable_gpg_check: yes
  become: yes

cannot download collection through mazer

mazer freeze without any error during download of the collection, all your other collection working correctly, i've read somewhere that trailing slash on galaxy.yml file can cause problem.
"galaxy.yml" of this collection got one on the "documentation" path, all your other projects didn't.

Unable to install with mazer

Hi,

mazer install crivetimihai.virtualization

Is looping indefinitely, I guess there is an issue with this package as following command worked perfectly (It seems to be blocked on page 2).

mazer install crivetimihai.development
mazer install crivetimihai.server
mazer install crivetimihai.workstation

Let me know if you want more details.
Regards,

Vagrant role - mismatched variable name for RHEL

In the Vagrant role, the task for RedHat references a variable redhat_packages, however the variable defined in the vars file is rhel_packages.

The variable name should be changed to be consistent in the task and the vars file.

The workaround for this issue is to set the expected variable to the one defined in the vars file:

- hosts: all
  tasks:
    - import_role:
        name: crivetimihai.virtualization.vagrant
      vars:
        redhat_packages: "{{ rhel_packages }}"

Unable to install vagrant on Ubuntu 18.04

When running this role I am getting the following error:

fatal: [localhost]: FAILED! => {"changed": false, "msg": "No package matching 'https://releases.hashicorp.com/vagrant/2.2.5/vagrant_2.2.5_x86_64.deb' is available"}

This is happening because in the install_Ubuntu.yml task it is calling the package module using the name parameter but passing a list of urls to a deb.
The only way to install a deb from a url according to ansible docs is by using the deb parameter.

Here is one way of fixing the error:

- name: install Ubuntu packages
  package:
    deb: "{{ item }}"
  loop: "{{ ubuntu_packages }}"
  become: yes

I'm sure there is probably a better way to address this issue rather than using the snippet above.

Add Fedora 31 in supported platforms for Docker virtualization

Hi,

First, thank you for these roles, they are awesome and I use them (picked up some roles, not the entire collection).

I just downloaded your collection and tested the docker virtualization installation over Fedora 31.
The results are succesful, so I'll PR the modification letting end users use it with this platform.

Best regards,
Charlie

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.