tasks, roles and modules: how best to compose functionality?

26 views
Skip to first unread message

nrser

unread,
Feb 20, 2015, 6:17:44 AM2/20/15
to ansible...@googlegroups.com
i'm just getting started with Ansible, and would appreciate some help on how best to compose functionality with tasks, roles and modules.

i'm thinking of a basic structure that i imagine is somewhat common, where
  • hosts have projects
  • projects have github repos
  • github repos have git module tasks that actually clone the repo
some pseudo code:

some-project
  github_repo:
    owner: nrser
    name: some-project

github_repo
  git:
    repo: g...@github.com:{{ owner }}/{{ name }}
    dest: "{{ gh_root }}/{{ owner }}/{{ name }}

how should i accomplish this in Ansible? should `some-project` and `github_repo` be tasks, roles...?

Dick Davies

unread,
Feb 20, 2015, 9:54:12 AM2/20/15
to ansible list
Have a look at 'parameterized roles' at :

http://docs.ansible.com/playbooks_roles.html#roles
> --
> 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 post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/72eb6b40-a3dc-4cd6-91e0-e1c4f4a61349%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages