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
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:
>>
>> ---
>&
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.
--
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
*
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
>
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
>
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
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
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,
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,
10 matches
Mail list logo