GithubHelp home page GithubHelp logo

r3drun3 / centos_ansible_provisioning Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 69 KB

Automate Docker testing with Ansible and Vagrant ๐Ÿ”ง๐Ÿฆพ

License: MIT License

Shell 100.00%
ansible devops docker docker-swarm iaac vagrant

centos_ansible_provisioning's Introduction

CentOS Ansible provisioning

License: MIT

Abstract

This repo contains DevOps\IaC procedures to automate the followings:

  1. Provisioning of 3 CentOS virtual machines (one control node and two worker nodes)
  2. Creation of a 50 GB ext4 partition for Docker
  3. Installation of Docker
  4. Installation of Docker Swarm
  5. Securing of Docker Rest Api via TLS certificate generation
  6. Configure Docker auto-start at boot
  7. Interact and deploy services on the Swarm from the control node.

Prerequisites

This code has been tested on a windows 11 host with vagrant version 2.2.19 and virtual box version 6.1.34.

By making use of the Ansible Local Vagrant provisioner we are able to provision the guest by executing ansible-playbook directly on the targets machine.

Followings are the required Vagrant Plugins:

  1. vagrant-disksize (0.1.3, global)
  2. vagrant-vbguest (0.21.0, global)

Instructions

Clone this repo and start the provisioning:

git clone https://github.com/R3DRUN3/centos_ansible_provisioning.git \
&& cd centos_ansible_provisioning && Vagrant up

Github Action

An ansible linting GitHub action is associated with push on this repo main branch:

Ansible Lint

Note that it fails because it cannot find some of the roles referenced in the playbook provisioning.yml:

alt text

This is not a real error but rather a false positive given by the fact that the procedure uses the vagrant ansible_local provisioner, which allows us to run playbooks on target machines.

This way the ansible galaxy roles do not need to be inside the repo (which could weigh down the code base in case of playbooks that use hundreds of roles) but they are automatically downloaded on targets machine via this line in the Vagrant file:

ansible.galaxy_command = "sudo ansible-galaxy install --role-file=%{role_file} --roles-path=%{roles_path} --force"

centos_ansible_provisioning's People

Contributors

r3drun3 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

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.