INTRODUCTION TO ANSIBLE
GALAXY
Alexander Saprykin
Senior Software Engineer
17.04.2018
Agenda
2
● What is Ansible Galaxy?
● Using Ansible Galaxy
● Galaxy 3.0
● Roadmap
3
What is Ansible Galaxy?
Ansible roles
4
● Ansible roles are a further level of abstraction that help to organize
playbooks
Ansible roles
5
● Ansible roles are a further level of abstraction that help to organize
playbooks
● Modular
● Reusable
● Configurable
● Distributable?
What is Ansible Galaxy?
6
● Official Ansible Roles repository
● Released in 2014
● Published to open source in 2016
● ~15 000 community roles imported
● Relies on GitHub as content provider
7
https://galaxy.ansible.com
What is Ansible Galaxy?
8
Command-Line Tool
● ansible-galaxy
● Comes bundled with Ansible
● Installs roles from Galaxy directly
● Or from Git
● Manages roles on the Galaxy website
USING ANSIBLE GALAXY
Search Roles
10
11
Download and Install Roles
Download and Install Roles
12
from Ansible Galaxy
Install a role:
ansible-galaxy install --roles-path . username.rolename
ansible-galaxy install username.rolename
Install to custom roles path directory:
Install from requirements.yaml file:
ansible-galaxy install -r requirements.yaml
Download and Install Roles
13
from any git-based SCM
ansible-galaxy install 
git+https://github.com/acme/role.git,v1.2.0
ansible-galaxy install 
git@gitlab.acme.com:mygroup/ansible-base.git,0b7cd353...
# from Galaxy
- src: bennojoy.nginx
# from GitHub
- src: https://github.com/bennojoy/nginx
# from GitLab or other git-based SCM
- src: git@gitlab.acme.com:mygroup/ansible-base.git
scm: git
version: "0.1"
Download and Install Roles
14
requirements.yaml format
15
Create your own role
Create role
16
Click to add subtitle
Use the init command to initialize the base structure of a new role:
ansible-galaxy init rolename
Using a Custom Role Skeleton
ansible-galaxy init --role-skeleton=/path/to/skeleton
role_name
Role structure
17
example
├── defaults
│ └── main.yml
├── files
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── tasks
│ └── main.yml
├── templates
├── tests
│ ├── inventory
│ └── test.yml
└── vars
└── main.yml
Import role
18
Import role
19
Import role
20
Import role
21
22
Questions?
GALAXY 3.X
Content vision is changing
24
Roles only
Roles
Modules
Plugins
APBs
Before After
Ansible Playbook Bundle (APB)
25
● Used to define and deploy complex groups of applications,
deployment configs, deployments, and services to an OpenShift
Origin cluster running the Ansible Service Broker.
● More details at:
https://github.com/ansibleplaybookbundle/ansible-playbook-bundle
UI Before 3.0
26
UI Redesign
27
PatternFly
28
Open Interface Project
Pattern Library
The PatternFly team designs and develops patterns based on an
understanding of use cases and requirements.
Code
Built on top of both Bootstrap 3 and AngularJS
Styles
Visual styles include color palette, icons, typography, terminology, and
wording.
UI Redesign
29
Features
30
● Multiple roles per repository
● New content types support (Modules, Plugins, etc.)
● UI redesign
● Improved search
● Basic content linting (Flake8, YAML Lint)
● Migrating to OpenShift
Roadmap
31
● Move modules out of Ansible repository
○ ~12 000 modules now
● Support multiple external providers (i.e. GitLab, BitBucket)
● On-premise installation
● Content storage
○ Integration with Pulp
Contribute
32
● Visit https://github.com/ansible/galaxy
● Join IRC #ansible-galaxy @ freenode
● Read Code of Conduct
● File issues
● Submit pull requests
THANK YOU
plus.google.com/+RedHat
linkedin.com/company/red-hat
youtube.com/user/RedHatVideos
facebook.com/redhatinc
twitter.com/RedHat

Introduction to ansible galaxy