Skip to content

lordoftheflies/ansible_collection_skeleton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

title categories language include_toc show_comments cascade
Ansible Collection Skeleton Manual
automation
template
yaml
true
false
banner
images/typewriter.jpg

Ansible Collection Skeleton

Collection template repository.

Status

[![Build Status](https://travis-ci.org/lordoftheflies/{{ role_name }}.svg?branch=master)](https://travis-ci.org/lordoftheflies/{{ role_name }})

Template

This readme file should contain a the name and a short description/quick docs of the collection and an optional link to docs/ for more complete documentation.

Directory Structure

Current directory structure:

  • docs/: local documentation for the collection
  • license.txt: optional copy of license(s) for this collection
  • galaxy.yml: source data for the MANIFEST.json that will be part of the collection package
  • playbooks/: playbooks reside here tasks/: this holds 'task list files' for include_tasks/import_tasks usage
  • plugins/: all ansible plugins and modules go here, each in its own subdir
  • modules/: ansible modules
  • lookups/: lookup plugins
  • filters/: Jinja2 filter plugins ... rest of plugins
  • README.md or README.rst: this file
  • roles/: directory for ansible roles
  • tests/: tests for the collection's content

Make an instance

Perform the following changes.

  1. Fill out metadata in ./galaxy.yml.
  2. Choose collection type (roles, site).
  3. Push your changes to GitHub
  4. Integration with Travis-CI
  5. Provision supported platforms
  6. Make a release
  7. Build and publish collection to Ansible Galaxy
  8. Update documentation (Documentation, Documentation)

Usage

Requirements

Development environment:

  • Vagrant: 2.2.7
  • Kvm

Production environments:

  • Ansible 2.9+
  • Python 3.4+

Dependencies

Setup roles:

ansible-galaxy role install -r requirements.yml -p ./roles

Setup collections:

ansible-galaxy collection install -r requirements.yml -p ./collections

Playbooks

Install plays:

ansible-playbook site.yml -K

Uninstall plays:

ansible-playbook purge.yml -K

Backup plays:

ansible-playbook backup.yml -K

Restore plays:

ansible-playbook restore.yml -K

Supported platforms

OS Version Distribution Supported ^1 Results
Ubuntu 14.10 Platform RGB(0,255,0) untested Platforms
Ubuntu 16.10 Platform RGB(0,255,0) untested Platforms
Ubuntu 18.10 Platform RGB(0,255,0) unstable Platforms
Ubuntu 19.04 Platform RGB(0,255,0) unstable Platforms
Ubuntu 19.10 Platform RGB(0,255,0) supported Platforms
Debian 7 Platform RGB(0,255,0) supported Platforms
CentOS 7 Platform RGB(0,255,0) supported Platforms
CentOS 8 Platform RGB(0,255,0) supported Platforms
Fedora 8 Platform RGB(0,255,0) unsupported Platforms
RedHat 8 Platform RGB(0,255,0) unsupported Platforms
ArchLinux 8 Platform RGB(0,255,0) unsupported Platforms
Kali 8 Platform RGB(0,255,0) unsupported Platforms
OpenSUSE 8 Platform RGB(0,255,0) unsupported Platforms
MacOS * Platform RGB(0,255,0) unsupported Platforms
Windows * Platform RGB(0,255,0) unsupported Platforms

Variables

Service subdomain

These details will remain hidden until expanded.

    
infrastructure_domain: "cherubits.hu"
infrastructure_services:
    - subdomain: plantuml
    

Results infrastructure_host will plantuml.cherubits.hu

Prequisites

Ansible Setup

@startuml
caption Figure 1: Ansible overview
component "Ansible Controller Machine" as acm
component "Ansible Managed Node" as amn
acm *- amn
@enduml

On Each Remote Machine

Add a new technical user for Ansible:

adduser ansible

On Controller Machine

Generate SSH key pair on Ansible Controller Machine:

ssh-add -t rsa -C $(git config user.email)
eval `ssh-agent -s`
ssh-add ~/.ssh/id_rsa
ssh-copy-id -i ~/.ssh/id_rsa

Author(s)

Releases

No releases published

Packages

No packages published