Hello,
How to best model the following scenario:
I have a set of hosts in one playbook.
[qa-machines]
HostA
HostB
HostC
I have a subset of these hosts that should receive additional roles.
[jenkins-slaves]
HostC
I have a Vagrantfile that I would like to use to set up one host of each
Am Mittwoch, 26. Oktober 2016 19:21:02 UTC+2 schrieb rup:
>
> We implemented this by having host files specific to an environment, so
> for example, a QA host file, a Prod host file, a Dev host file, etc. Then
> the groupings within the host file would be based off what they were used
> for,
Hi,
I ran into the issue that I wanted to include a role based on a fact.
Specifically, I wanted the firewall role (configuring iptables) to not be
included when the playbook is run locally against a Vagrant VM.
I noticed that the facts are not available (= empty string) when I do it
like
However I do have another question:
Is there a way to easily filter this list to at least exclude the temporary
variables that got introduced during the playbook run, for example from
"register" ?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project"
@Kai Stian Olstad
Thank you, the magic that is hostvars[inventory_hostname] was exactly what
I was looking for!
--
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
Hi,
maybe I am being stupid here, but why doesn't it work, that when I call the
set_fact
module, and then run the
setup
module, my newly set fact is not returned?
What else do I have to do?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project"
Am Donnerstag, 1. Dezember 2016 12:38:33 UTC+1 schrieb Ali Jabir:
>
> Hi there,
>
> Try doing,
>
> - name: Set fact
> set_fact:
> my_date_as_fact: my_date
>
> Thanks
> -AliJ
>
That is what I have, it was a typo in my post.
--
You received this message because you are subscribed to the
This is what I have now, and it is still not working.
- name: Get app version
command: curl -H application/json localhost:8088/rs
register: get_version
ignore_errors: true
- name: Set app version as fact
set_fact:
fact_app_version:
app_version: "{{ ((get_version |
>
>
> - set_fact: var2 = "something"
> when: var2 is not defined
>
> - set_fact: var3 = "something"
> when: var3 is not defined
>
Try this without spaces around the '=' .
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe
For example:
- name: Get date
command curl http://some-url
register: my_date
- name: Set fact
set_fact:
my_date_as_fact: my_date
- name: Gather facts
setup:
register: {{ ansible_facts }}
- name: Print facts
debug: msg={{ ansible_facts }}
"my_date_as_fact" is not included
>
>
> I'm trying to create a test role to replicate this, but has anyone seen
> anything similar ?
>
Happens for me too, running 'make reinstall' with async: 3600 and poll: 10
and after 4 minutes it fails with:
FAILED! => {"ansible_job_id": "664102975902.6606", "changed": false, "failed":
11 matches
Mail list logo