[ansible-project] service_facts gathering the wrong status

2019-01-10 Thread Francis Santos
Hi everyone, I have a problem where a task has a condition to run only when the service is "running". However when I gather the facts, it gathers the wrong status. How do I fix it? I already restart the service but it is not fixed. ACTUAL SERVICE ● consul.service - LSB: Manage the consul server

Re: [ansible-project] Re: How to randomize hosts but not repeat the ones that already were selected

2019-01-09 Thread Francis Santos
the following for more details > https://docs.ansible.com/ansible/latest/user_guide/intro_patterns.html > > On Wednesday, January 9, 2019 at 5:49:56 AM UTC-8, Francis Santos wrote: >> >> Hi all, >> >> With this script I can randomize any host: >> >> --- >&

[ansible-project] How to randomize hosts but not repeat the ones that already were selected

2019-01-09 Thread Francis Santos
Hi all, With this script I can randomize any host: --- - hosts: "{{ (groups['all'] | shuffle)[0:1] }}" become: true vars: - ansible_sudo_pass: How can I add the proposition to skip the ones that were selected? So I can use the whole pool of hosts before selecting them again. --

[ansible-project] Re: Inventory scripts: How to add debug info when run via Ansible?

2019-01-03 Thread Francis Santos
Is this what you are looking for? tasks: - name: enabling consul service: name=consul enabled=yes state=started when: - service: name=consul state=stopped *register: results ### stores output on a variable* ignore_errors: yes - name: show results of disabling consul *

Re: [ansible-project] How to Random Roles

2019-01-03 Thread Francis Santos
uess we can consider this issue solved. Thanks anyways, guys On Thursday, January 3, 2019 at 11:09:40 AM UTC-2, Francis Santos wrote: > > I gotta random both the hosts and the roles. > I successfully randomed the hosts, but I not getting the roles to random. > Here is what I got >

Re: [ansible-project] How to random roles

2019-01-03 Thread Francis Santos
uess we can consider this issue solved. Thanks anyways, guys On Wednesday, January 2, 2019 at 11:53:44 AM UTC-2, Francis Santos wrote: > > I gotta random both the hosts and the roles. > I successfully randomed the hosts, but I not getting the roles to random. > Here is what I got >

Re: [ansible-project] How to Random Roles

2019-01-03 Thread Francis Santos
No, the picture is that the role is not on the hosts. First I random a host (that script does that). Once a host is selected then the role is randomized. On Thursday, January 3, 2019 at 11:09:40 AM UTC-2, Francis Santos wrote: > > I gotta random both the hosts and the roles. > I suc

[ansible-project] How to Random Roles

2019-01-03 Thread Francis Santos
I gotta random both the hosts and the roles. I successfully randomed the hosts, but I not getting the roles to random. Here is what I got --- - hosts: "{{ (groups['foo'] | shuffle)[0:1] }}" become: yes vars: - ansible_sudo_pass: ** * roles: * * - reboot || shutdown* Need a way

[ansible-project] How to Random Roles

2019-01-02 Thread Francis Santos
I gotta random both the hosts and the roles. I successfully randomed the hosts, but I not getting the roles to random. Here is what I got --- - hosts: "{{ (groups['foo'] | shuffle)[0:1] }}" become: yes vars: - ansible_sudo_pass: ** roles: - reboot #one of the roles are reboot,

[ansible-project] How to random roles

2019-01-02 Thread Francis Santos
I gotta random both the hosts and the roles. I successfully randomed the hosts, but I not getting the roles to random. Here is what I got --- - hosts: "{{ (groups['foo'] | shuffle)[0:1] }}" become: yes vars: - ansible_sudo_pass: ** roles: - reboot #one of the roles are reboot,