[scl.org] SCL and Ansible ?
Petr Hracek
phracek at redhat.com
Mon Oct 14 08:36:53 UTC 2019
Hi Samuel,
I have been writing a couple of ansible-playbooks but did not try it with
SCL.
You playbook w/o comments look good.
But I don't understand the scenario.
How do you run the ansible-playbook?
>From container or from shell?
Can you please give a reproducer steps, so I can analyze it?
Greetings
Petr
pá 11. 10. 2019 v 11:23 odesílatel <viscapi at cines.fr> napsal:
> Dear all,
>
> Silly question: is there a way to call "scl enable" from within an Ansible
> role ?
>
> So far we've been trying the command, shell and scripts modules, but to no
> avail...
>
>
> https://docs.ansible.com/ansible/latest/modules/command_module.html#command-module
>
> https://docs.ansible.com/ansible/latest/modules/shell_module.html#shell-module
>
> https://docs.ansible.com/ansible/latest/modules/script_module.html#script-module
>
> Here are some failed attempts:
>
> - name: Start using the software collection for maven
> shell: scl_enabled rh-maven35
> register: swap_exists
> ignore_errors: true
> #script: test.sh
> # shell: scl enable /etc/scl/conf//opt/rh/rh-maven35 bash && echo toto
> #shell: /usr/bin/scl enable rh-maven35 bash
> # args:
> # warn: yes
> # chdir: "{{ path_to_pastis }}"
> #easy_install:
> # name: scl
> # args:
> # executable: "/usr/bin/scl enable rh-maven35 bash"
> # command: |
> # /usr/bin/scl enable rh-maven35 bash
> #bash
> # shell: |
> # scl enable rh-maven35 bash
> #bash
> # args:
> # executable: /bin/bash
>
> I think the root issue is that, as far as I understand, "scl enable"
> starts a new shell and sources environment variables in there, while
> Ansible is still waiting for some RC in the parent shell. Thus Ansible is
> not really failing, but just keeps on waiting for ever...
>
> Any help would be greatly appreciated.
>
> Best regards,
>
> Samuel from CINES
>
> https://www.cines.fr/en/
>
> --
>
> Samuel VISCAPI
>
> +33(0)4 67 14 14 36
> viscapi at cines.fr
> IM: sviscapi (Skype)
>
> _______________________________________________
> SCLorg mailing list
> SCLorg at redhat.com
> https://www.redhat.com/mailman/listinfo/sclorg
>
--
Petr Hracek
email: phracek at redhat.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/sclorg/attachments/20191014/606ce041/attachment.htm>
More information about the SCLorg
mailing list