I think you don't understand the structure of "interfaces"
> Here the output of the debug:
>
> ok: [server1.infra.sys] => {
> "interfaces": [
> {
> "bootproto": "none",
> "device": "ens192",
> "gateway": "1.1.1.250",
>
s }}' in the available
> lookup plugins"}
>
>
> Am Freitag, 30. November 2018 08:54:22 UTC+1 schrieb Uwe Sauter:
>
> When I'm debugging Ansible Playbooks and I don't know if I can access a
> variable I usually have a debug block.
>
> In your case this might look
When I'm debugging Ansible Playbooks and I don't know if I can access a
variable I usually have a debug block.
In your case this might look something like:
#
- debug:
msg: ''{{ item | to_nice_yaml }}'
loop: '{{ interfaces }}'
- meta: end_play
#
Put this block in front of the
ay, November 29, 2018 at 2:40:58 PM UTC-8, Uwe Sauter wrote:
>
> Look for group vars and put all servers in the same group in the
> inventory file.
>
> Am 29.11.18 um 23:11 schrieb Andy:
> > I am new to ansible.
> > I create
Look for group vars and put all servers in the same group in the inventory file.
Am 29.11.18 um 23:11 schrieb Andy:
I am new to ansible.
I create a yaml file with multiple hosts defined
---
-hosts: localhost
vars:
tasks:
-hosts: webserver1
vars: same as localhost
tasks:
https://docs.ansible.com/ansible/2.7/modules/meta_module.html
- meta: end_play
when: condition is true
Am 24.11.18 um 18:35 schrieb Kai Stian Olstad:
On Saturday, 24 November 2018 18:19:26 CET Pandu jh wrote:
I have 3 plays in a playbook. In a task in 1st play, If the desired value
is
What version of Ansible?
Are you sure the files are encoded in UTF-8?
Am 23. November 2018 06:37:33 MEZ schrieb Eric Chang :
>thanks for reply , I think my source file is yaml file
>I can pass the yaml validator online
>
>here are 2 items in teams.yml
>
>"teams": [
>> {"chinese_name":
Hi,
your file looks like JSON to me, not like YAML (though one is a subset of the
other, if I remember correctly…).
My test:
### teams.yaml ###
---
chinese_name: "\u8ca1\u52d9\u6703\u8a08\u8655"
description: "\u8ca1\u52d9\u6703\u8a08\u8655"
gid": 10126
location":
- "hq"
name: "ac"
users:
-
Hi,
currently with ansible.cfg containing
[defaults]
display_ok_hosts = no
display_skipped_hosts = no
stdout_callback = yaml
no output is given when I use the debug module. This is obviously correct
behavior because the debug task returns ok.
But it makes debugging hard if you have a lot of
Ah, I missed that line.
Thanks.
Am 05.11.18 um 16:18 schrieb Kai Stian Olstad:
> On Monday, 5 November 2018 16:06:19 CET Uwe Sauter wrote:
>> As far as I can tell there is no such loop in the template:
>
> It is, i just formatted it to show it more clearly.
>
>
>&
rror=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
>From which message did you get that loop in the template?
Am 05.11.18 um 15:51 schrieb Kai Stian Olstad:
> On Monday, 5 November 2018 15:38:51 CET Uwe Sauter wrote:
>> Sure, but the template will only be used for the one
Sure, but the template will only be used for the one host and as such should
not look for variables of other hosts, right?
Am 05.11.18 um 15:18 schrieb Kai Stian Olstad:
> On 05.11.2018 15:08, Uwe Sauter wrote:
>> Because he was running the playbook with this commandline:
>>
>
Because he was running the playbook with this commandline:
ansible-playbook -i infra --limit mysql04 main.yml --tags "mysql" -vvv
Am 05.11.18 um 15:06 schrieb Kai Stian Olstad:
> On 04.11.2018 23:50, Tom K. wrote:
>> Hey Uwe,
>>
>> I hear you and apologies. Was trying to keep it from getting
with -vvv.
Am 04.11.18 um 16:25 schrieb Tom K.:
On Sunday, November 4, 2018 at 10:20:56 AM UTC-5, Uwe Sauter wrote:
Would you mind sending the complete output of
ansible-playbook main.yaml -vvv
?
I got a result now but need to continue this in a bit as I need to step away:
|
[root
Would you mind sending the complete output of
ansible-playbook main.yaml -vvv
?
Am 04.11.18 um 16:16 schrieb Tom K.:
On Sunday, November 4, 2018 at 10:03:49 AM UTC-5, Uwe Sauter wrote:
OK, more comments:
>
> So I've modified the first main.yml as f
OK, more comments:
So I've modified the first main.yml as follows:
|
# cat main.yml
---
-name:Gatherall facts prior to execution
hosts:mysql
gather_facts:false
Not gathering facts here will lead you to miss many of the ansible_* variables.
tasks:
-name:Dumpansible_default_ipv4
As the error message state, 'HostVarsVars' is an Python object. Without looking into the source code I suspect it to be
some kind of Class inside the HostVars object that holds the actual values you can access via
hostvars[inventory_hostname]["key"].
Am 04.11.18 um 15:28 schrieb Tom K.:
On
Did you check /tmp on your mysql host? This will copy 'content' to the destination on the target host, not on the host
running the playbook.
Am 04.11.18 um 15:22 schrieb Tom K.:
On Sunday, November 4, 2018 at 2:45:06 AM UTC-5, Uwe Sauter wrote:
Hi,
Am 04.11.18 um 00:45 schrieb
Hi,
Am 04.11.18 um 00:45 schrieb Tom K.:
Thanks Uwe!
|
# cat main.yml
---
-name:Gatherall facts prior to execution
hosts:mysql
gather_facts:yes
-name:Installandconfigure MySQL
hosts:mysql
sudo:yes
roles:
-mysql
tags:mysql
|
First of all: you don't need the first play
Could you show us the play where this happens?
Am 03.11.18 um 21:18 schrieb Tom K.:
Hey All,
Receiving the following from Ansible 2.7 and not sure if I should be
predefining a variable and pointing to this fact first or perhaps this
is related to something else? (Relatively new to Ansible)
In order to access some ansible_* variables you need to gather facts on the
host before.
See e.g.
https://stackoverflow.com/questions/45908067/whats-the-difference-between-inventory-hostname-and-ansible-hostname
Am 03.11.18 um 21:15 schrieb Barry Kaplan:
Why would this be? It has lots and
The ping module is not the classical ping command but an Ansible module that
will connetc to the remote host via SSH and send back
a "pong" if that succeeds. See the docs.
If you want to use the classical ping command you need to use the "command" or
"shell" module to call that from Ansible;
Hi all,
I'm having a performance issue with local execution of the copy and template
modules that are put into task files. Both modules
are used in with_nested loops where item[0] is about 100 elements and item[1]
is about 6 elements long for copy and 10 elements
long for template.
Execution
ansible_winrm_transport: basic
should be
ansible_winrm_transport=basic
Am 10.09.18 um 11:23 schrieb Victor Sava:
> [all:vars]
> ansible_connection=winrm
> ansible_user=doomaine\jenkins
> ansible_pass=asdasdasda
> ansible_winrm_transport: basic
>
>
> error :
> * Failed to parse
Thanks, that worked. Though it feels unusual and a little like cheating Ansible.
Regards,
Uwe
Am 24.08.18 um 10:17 schrieb Kai Stian Olstad:
> On 24.08.2018 09:33, Uwe Sauter wrote:
>> I have a list of files where I need to check existence and fail if one
>> doesn't e
Hi all,
I have a list of files where I need to check existence and fail if one doesn't
exist.
I'd expect the fail module to *just* output the defined message when the
condition is true
but instead the complete item is printed.
Is there a way to make the output less verbose (but keep msg)?
Hi all,
I'm trying to reduce the size of the locale archive on CentOS 7.4 as described
in [1] and [2]. Ansible version is 2.4.2.0-2.el7
For this I have a script on the client, that calls the needed commands:
## /root/bin/rebuild_locale.sh
#!/bin/bash
LOCALES="en_US:de_DE"
mv
You're welcome.
Am 29.01.2018 um 19:32 schrieb John Harmon:
>
> Uwe Sauter,
>
> It worked perfectly! Thank you.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this
What's wrong with "with_nested"?
#
- name: Update ifcfg-* files
ini_file:
path: "{{ net_path }}{{ item[1] }}"
no_extra_spaces: true
section: null
state: present
option: "{{ item[0].option }}"
value: "{{ item[0].value }}"
with_nested:
- [{ option:
What about:
- include_tasks: '{{ item }}'
with_items:
- test.yml
- test2.yml
- test3.yml
when:install_type |lower |search ("n")
Am 23.01.2018 um 23:44 schrieb John Harmon:
I can't seem to find examples on this that show more than one task/yml file. How can I specify multiple
Already did in my previous answer. You need to remove items like {{ }} or {% %}.
Am 01.09.2017 um 10:18 schrieb Prologas:
> Can you take an example of correct syntax?
>
> On Friday, September 1, 2017 at 11:15:09 AM UTC+3, Uwe Sauter wrote:
>
> There has been a change (I th
There has been a change (I think between 1.9 and 2.x). As the warning explains,
you should rewrite your when statement:
when:
- ansible_default_ipv4.macaddress == wildfly_vm1_server_macaddress
Am 01.09.2017 um 10:07 schrieb Prologas:
> Hello,
>
> strange output comes to my ansible console,
Due to the nature of asynchronous execution I don't think there is a way to do
what you want to achieve. If you can afford the
time you could serialize your playbooks by putting "serial: 1" on the same
level as "hosts". But even then I'm not sure in which
host order Ansible executes the
HANGELOG.md
> - composer.json
> - .editorconfig
> - .gitignore
> - index.php
> - LICENSE.txt
> - system
> - vendor
> tags: grav, grav-sites
>
>
> On Mon, Aug 28, 2017 at 12:52 PM, Uwe Sauter <uwe.sauter...@gmail.com
> <mai
I'm not quiet sure I understand your data model but instead of with_items have
a look at with_dict.
Am 28.08.2017 um 21:51 schrieb Michael Bushey:
> Hello,
>
> I have a dict that contains a list of sites. For each of these sites I would
> like to provide a list of symlinks to
> create provided
I have a template for ifcfg-* files where I not only fill in DNS entries but
also all the other network configuration
stuff. I put this into a role and all variables are in host_vars/*.yaml files.
Every time I wish to change the
configuration I change the host_vars file and reapply the role
Did you look into "local_tmp" and "remote_tmp" configured in your Ansible
config?
Am 14.08.2017 um 21:46 schrieb 'Brian Williams' via Ansible Project:
> If a playbook ever gets cancelled during the download of a large file the
> following execution some systems get "No space
> left on device"
Hi again,
I'm looking for a way to merge multiple lists into one. Difficulty is that the
lists have dynamic names.
E.g.
cluster.yaml
---
racks: ['rack01', 'rack02'] # might be many more racks
##
rack01.yaml
---
rack_number: 1
compute_nodes: ['alpha',
Hi,
I'm trying to keep my playbooks and related var files portable. Currently I'm
stuck with the following:
### input.yaml ###
---
base: '/exports'
image: '{{ base }}/image'
config: '{{ base }}/config'
### playbook ###
---
- hosts: localhost
connection: local
gather_facts:
Just to question the obvious: this is not the use case to distribute public
keys into ~/.ssh/authorized_keys?
If it is, use the "authorized_key" module…
Am 04.08.2017 um 12:20 schrieb chbndrhnns:
> Hey there,
>
> I have a setup with host1, host2, host3. I need to read a file into a
>
An uneducated guess: did you try to create the missing file?
Am 03.07.2017 um 08:52 schrieb Luvpreet Singh:
> On the official page, it is said that to host ansible tower behind nginx, you
> need to provide headers in the
> `/etc/tower/conf.d/remote_host_headers.py` file.
>
> But, in my
Running the following playbook on localhost
---
- hosts: localhost
tasks:
- name: "Run ssh commands for remove old id_rsa files and create new ssh
keys"
shell: ssh-keygen -f /tmp/id_rsa -t rsa -q -N ""
args:
creates: /tmp/id_rsa
results in:
###$
enied.", "stdout":
"Saving the key failed: /home/dp794d/.ssh/id_rsa.", "stdout_lines": ["Saving
the key failed:
/home/dp794d/.ssh/id_rsa."], "warnings": []}
I am doing something wrong, as this is new thing for me. Please suggest
On Wednesday, 26 Ap
Why don't you run "ssh-keygen -f -t -q -N ''" ?
Am 26.04.2017 um 19:42 schrieb nishant bawane:
Hi below is the command i want to run using shell to create the keys.
shell: ssh dp794d@130.6.50.132 "cd /home/dp794d/.ssh;ssh-keygen"
When i run this command on server, it askes to press the
Try the attached Python script.
But probably you just have the wrong number of spaces for indentation.
Try:
---
- hosts: node02
vars:
ORACLE_BASE: /u01/oracle/product
ORACLE_HOME: /u01/oracle/product/11.2.0
remote_user: oracle
sudo_user: root
sudo: false
Putting single quotes around should solve this.
host_ip = '"http://{{ ansible_default_ipv4.address }}"'
Regards,
Uwe
Am 02.11.2016 um 21:04 schrieb ZillaYT:
> I have a template that does has this line
>
> |
> host_ip ="http://{{ ansible_default_ipv4.address }}"
> |
>
> which results
└── inventory
Regards,
Uwe
Am 01.09.2016 um 12:29 schrieb ankur.c...@gmail.com:
> It can be inside the same folder as the playbook.
>
> root
> -- group_vars/all.yml
> -- host_vars/some_host.yml
> -- myPlaybook.yml
>
> On Thursday, September 1, 2016 at
Hi all,
I'm currently struggling with how to tell Ansible where it can find host_vars
and group_vars folders. Is there an environmet
variable for it? Does it have to be inside the same folder as the playbook?
Regards,
Uwe
--
You received this message because you are subscribed to the
Hi all,
I'm a bit unsure about YAML syntax regarding lists. Could someone please verify
that the following two lists are equivalent?
No indentation for list items:
---
test:
- a
- b
- c
Indentation for list items:
---
test:
- a
- b
- c
Thanks,
Uwe
--
You received this
I'd really like to see some improvements to this module as well. The current
situation keeps me from using it. Instead I
also have a bunch of shell tasks that handle registering and attaching a host
to a specific pool.
The problem I have with this module is that there is an argument called
Hi,
I'm trying to use redhat_subscription to register and subscribe hosts by pool
ID, not subscription name. Is this
possible? As I have several subscriptions that overlap in some features I'd
like to be explicit about which host gets
subscribed to which pool by using the unique pool ID.
What about:
- vars:
monitor_group: "glance"
- hosts: "{{ monitor_group }}"
roles:
- { role: icinga2-check-commands, tags: ['monitor-cloud'] }
I'm not saying that this'll work as I am trying to figure out variables myself.
But you could give it a try.
Am 13.11.2015 um 16:53 schrieb
his.
> The monitor_cloud variable is in the [all:vars] section of the inventory.
>
> On Friday, November 13, 2015 at 12:58:44 PM UTC-3, Uwe Sauter wrote:
>
> What about:
>
> - vars:
> monitor_group: "glance"
> - hosts: "{{ monito
Thanks Brian!
Am 03.11.2015 um 00:47 schrieb Brian Coca:
> that is what the authorized_keys module is for
> http://docs.ansible.com/ansible/authorized_key_module.html, use that
> instead to copy the public key. Also you should not be copying the
> private key.
>
--
You received this message
Hi all,
just beginning my adventure with Ansible.
Following situation: I'm trying to ensure that a user called "ansible" is
present on all hosts that should be managed by Ansible.
Creating group and user works so far. Now I'm trying to enable password-less
SSH login for that user by copying a
Can you access your host via SSH keys? You cannot use Ansible in a productive
environment when you are asked for the password at
each run…
Am 13.07.2015 um 08:43 schrieb Gaurav Suryagandh:
Hello All,
I am trying to use script module of ansible to execute my local script on the
remote
The ping module is *NOT* Ansible trying to reach a host via ICMP message.
Ansible will try to connect to the host via SSH and
execute the ping module which just generates a pong answer.
Am 20.06.2015 um 18:36 schrieb Suneel Gali:
Hi Team,
I just started working on ansible and using online
Brian,
thanks for your answer.
As I'm not yet familiar with Ansible, do you have any pointers to documentation
where I can find what you described (esp. the last
point about additional pathing)?
Am 29.05.2015 um 00:18 schrieb Brian Coca:
I don't see a reason it would not.
First ansible
Hi all,
a similar question was already posted on Serverfault
(http://serverfault.com/questions/693698/config-management-for-nfs-root-cluster)
but got turned down as being off-topic.
To summarize:
Is Ansible capable of handling diskless clients that only have read-only
storage mounted (besides
59 matches
Mail list logo