How to automate ansible automation runs from Python?

33 views
Skip to first unread message

radeck...@gmail.com

unread,
Nov 12, 2020, 12:00:12 PM11/12/20
to Ansible Project
Hi All,

I have some ansible role structure which I use through playbooks in one of my gitlab repositories. Every time a developer needs to add a new service which uses some role/-s I manually update the code (eg. add a playbook, add some entries to defaults/main.yml, whatever needed).

I would like to automate this process from Python as this is our main language in our devops team. One of my dev coworkers passed me info about https://github.com/cookiecutter/cookiecutter and it seems quite reasonable. I am only wondering if there are other better options.

Has anyone created this kind of a setup? Any hints?

Thanks in advance & have a nice day!

Best Regards,
Rafal.

Lars Liedtke

unread,
Nov 13, 2020, 3:10:36 AM11/13/20
to ansible...@googlegroups.com

Hey,

I have worked with cookiecutter, and it is nice. Bear in mind though, that the initial Project configuration needs some work and thought. But when you have everything setup, then it can really cut your project creation times.

I cannot not really advise you on how to do it, beacuse even though we are using ansible everyone, has git their own small differences in project setup. But the cookicutter doc is sufficient to adapt the tipps given there to ansible. From there you have to see how you want to setup everything and what works best for you.

Cheers

Lars

Am 12.11.20 um 18:00 schrieb radeck...@gmail.com:
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/534c3966-135f-4e34-95e3-06118e9e031an%40googlegroups.com.
-- 
---
punkt.de GmbH
Lars Liedtke
.infrastructure

Kaiserallee 13a	
76133 Karlsruhe

Tel. +49 721 9109 500
https://infrastructure.punkt.de
in...@punkt.de

AG Mannheim 108285
Geschäftsführer: Jürgen Egeling, Daniel Lienert, Fabian Stein

Sam Doran

unread,
Nov 17, 2020, 9:58:22 AM11/17/20
to ansible...@googlegroups.com
Rafal,

I use and maintain two cookiecutter templates for creating Ansible roles.


They may serve as a useful example for how to use cookiecutter. I haven't found a better tool, though I stopped looking once I found cookiecutter since it met my needs.

---

Sam
Reply all
Reply to author
Forward
0 new messages