SlideShare a Scribd company logo
Ansible autogenerating values
Problem
● Some services needs new port number for new
instance, for example php-fpm with Apache pre
2.4.9.
● I can add new port number into website
definiton
– But it is stupid hand work!
– What kind of tool is Ansible, If it cannot do so simple
thing?
group_vars/services.yml
Solution
● 2 problems to solve:
– Find out new port value.
– Save it for later use.
● We need to do several steps per value, which
is/was problem in Ansible.
● Dynamic includes to the rescue!
apache.yml
apache_generate_port_numbers.ym
l
What about generating usernames?
● You can use previous solution to generate non-
random users base on pattern like user1,
user2, ….
● But what if we want usernames to be as
random as possible?
● We can take similar approach.
Ssh.yml
ssh_generate_usernames.yml
Conclusion
● You can generate various values on the fly as
needed thru Ansible.
– Simpler data definitions.
– One less place for humans errors.
– A little less of stupid work.
● Profit!
Q/A
● Want to know more about ansible: Doing trainings: www.ansible.cz
● Thanks!
David Karban
david@karban.eu
www.karban.eu
https://twitter.com/davidkarban
https://github.com/davidkarban/

More Related Content

PPTX
Asynchronous Programming in .NET
ODP
Small eigen collider
PPTX
Route planning
PDF
Javascript internals
PPTX
Elm: Make Yourself A Happy Front-end Web Developer
KEY
Ruby Testing: Cucumber and RSpec
PDF
Dutch hug
PDF
Play Framework
Asynchronous Programming in .NET
Small eigen collider
Route planning
Javascript internals
Elm: Make Yourself A Happy Front-end Web Developer
Ruby Testing: Cucumber and RSpec
Dutch hug
Play Framework

Similar to Generating ephermal values in ansible (20)

PDF
Ansible automation tool with modules
PDF
Ansible Tutorial.pdf
PDF
Ansible - Hands on Training
PDF
More tips n tricks
PPTX
Ansible.pptx
PDF
Automation with ansible
PPTX
ansible : Infrastructure automation,idempotent and more
PDF
Ansible new paradigms for orchestration
PDF
IT Automation with Ansible
PPTX
Introduction to Ansible - Jan 28 - Austin MeetUp
PPTX
Ansible as configuration management tool for devops
PDF
Ansible not only for Dummies
PPTX
Automating with ansible (Part A)
PPT
Learn basic ansible using docker
PDF
Getting Started with Ansible
PDF
Ansible101
PDF
Ansible for Configuration Management for Lohika DevOps training 2018 @ Lohika...
PPTX
Ansible for Beginners
PDF
Dal caos all’automazione di sistemi e infrastrutture IT con Ansible
Ansible automation tool with modules
Ansible Tutorial.pdf
Ansible - Hands on Training
More tips n tricks
Ansible.pptx
Automation with ansible
ansible : Infrastructure automation,idempotent and more
Ansible new paradigms for orchestration
IT Automation with Ansible
Introduction to Ansible - Jan 28 - Austin MeetUp
Ansible as configuration management tool for devops
Ansible not only for Dummies
Automating with ansible (Part A)
Learn basic ansible using docker
Getting Started with Ansible
Ansible101
Ansible for Configuration Management for Lohika DevOps training 2018 @ Lohika...
Ansible for Beginners
Dal caos all’automazione di sistemi e infrastrutture IT con Ansible
Ad

Recently uploaded (20)

PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
1. Introduction to Computer Programming.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Mushroom cultivation and it's methods.pdf
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Hybrid model detection and classification of lung cancer
PDF
August Patch Tuesday
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PPTX
TLE Review Electricity (Electricity).pptx
PPTX
A Presentation on Touch Screen Technology
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Heart disease approach using modified random forest and particle swarm optimi...
gpt5_lecture_notes_comprehensive_20250812015547.pdf
1. Introduction to Computer Programming.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Mushroom cultivation and it's methods.pdf
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Hybrid model detection and classification of lung cancer
August Patch Tuesday
Digital-Transformation-Roadmap-for-Companies.pptx
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
TLE Review Electricity (Electricity).pptx
A Presentation on Touch Screen Technology
Enhancing emotion recognition model for a student engagement use case through...
Building Integrated photovoltaic BIPV_UPV.pdf
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Encapsulation_ Review paper, used for researhc scholars
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Ad

Generating ephermal values in ansible

  • 2. Problem ● Some services needs new port number for new instance, for example php-fpm with Apache pre 2.4.9. ● I can add new port number into website definiton – But it is stupid hand work! – What kind of tool is Ansible, If it cannot do so simple thing?
  • 4. Solution ● 2 problems to solve: – Find out new port value. – Save it for later use. ● We need to do several steps per value, which is/was problem in Ansible. ● Dynamic includes to the rescue!
  • 7. What about generating usernames? ● You can use previous solution to generate non- random users base on pattern like user1, user2, …. ● But what if we want usernames to be as random as possible? ● We can take similar approach.
  • 10. Conclusion ● You can generate various values on the fly as needed thru Ansible. – Simpler data definitions. – One less place for humans errors. – A little less of stupid work. ● Profit!
  • 11. Q/A ● Want to know more about ansible: Doing trainings: www.ansible.cz ● Thanks! David Karban david@karban.eu www.karban.eu https://twitter.com/davidkarban https://github.com/davidkarban/