I often install the Java JDK installation. Using a role makes this touch easier. I tried several different ways (including many .gitmodules and submodules ... I need to use several git systems to work, and it all gets ugly). My biggest requirement is that I will not check the role code in my playbook project, basically, so I can keep everything in one place.
The contents of my requirements.yml file:
- src: https://github.com/staylorx/ansible-role-wls-prep.git version: master name: staylorx.wls-prep - src: https://my-work-git-extravaganza.com version: 2.x name: coolplace.niftyrole
I run a separate playbook, install-role.yml:
--- - hosts: localhost tasks: - file: path: roles state: absent - local_action: command ansible-galaxy install -r requirements.yml --roles-path roles - lineinfile: dest: .gitignore regexp: '^\/roles$' line: '/roles' state: present
I launch this first play, then I launch my roles in any textbook. For me, the secret is to ignore its git, so I am not checking roles by mistake. In addition, since I destroy the folder every time, I guarantee that I do not need to force or ignore errors.
staylorx Feb 10 '16 at 15:27 2016-02-10 15:27
source share