Kool. So it's really saying (bolded):
ansible-playbook -i infra --limit mysql06 main.yml --tags "mysql" -v --check
fatal: [mysql06]: FAILED! => {"changed": false, "msg":
"AnsibleUndefinedVariable:
'ansible.vars.hostvars.HostVarsVars object' has no attribute
'ansible_default_ipv4' *for mysql05
On Monday, 19 November 2018 07:34:17 CET Tom K. wrote:
> ansible-playbook -i infra --limit mysql06 main.yml --tags "mysql" -v --check
>
> fatal: [mysql06]: FAILED! => {"changed": false, "msg":
> "AnsibleUndefinedVariable:
> 'ansible.vars.hostvars.HostVarsVars object' has no attribute
> 'ansible
So I've made two more empty hosts and called them *mysql05* and *mysql06*
and tested on all 3 (this way I don't blow away my working cluster). Now I
removed the limit flag and run it like this:
# ansible-playbook -i infra main.yml --tags "mysql" -v
Everything worked well and the */etc/my.cnf*
Hi Tom,
Can you try a couple of options and post it to this thread please ?
With the same inventory file:
[mysql]
mysql01
mysql02
mysql03
mysql04
ansible-playbook -i infra --limit mysql02 main.yml --tags "mysql" -v
ansible-playbook -i infra --limit mysql03 main.yml --tags "mysq
On 14.11.2018 14:49, Tom K. wrote:
On Tuesday, November 13, 2018 at 3:10:18 AM UTC-5, Tom K. wrote:
Ok. So I removed a couple of tags from the mysql task "mysql : Copy
my.cnf
global MySQL configuration." and adjusted the play as follows:
The playbook is fine, the problem is the limit optio
On Tuesday, November 13, 2018 at 3:10:18 AM UTC-5, Tom K. wrote:
>
>
>
> On Monday, November 5, 2018 at 9:52:15 AM UTC-5, Kai Stian Olstad wrote:
>>
>> On Monday, 5 November 2018 15:38:51 CET Uwe Sauter wrote:
>> > Sure, but the template will only be used for the one host and as such
>> should
On Monday, November 5, 2018 at 9:52:15 AM UTC-5, Kai Stian Olstad wrote:
>
> On Monday, 5 November 2018 15:38:51 CET Uwe Sauter wrote:
> > Sure, but the template will only be used for the one host and as such
> should not look for variables of other hosts, right?
>
> It will look up the variab
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.
>
>
>> [root@awx02 mysql]# cat tem
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.
> [root@awx02 mysql]# cat templates/my.cnf.j2
> [mysqld]
> datadir=/var/lib/mysql
> socket=/var/lib/mysql/mysql.sock
> user
As far as I can tell there is no such loop in the template:
[root@awx02 mysql]# cat templates/my.cnf.j2
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
binlog_format=ROW
bind-address="{{ ansible_default_ipv4.address }}"
default_storage_engine=innodb
innodb_autoinc_lock
On Monday, 5 November 2018 15:38:51 CET Uwe Sauter wrote:
> Sure, but the template will only be used for the one host and as such should
> not look for variables of other hosts, right?
It will look up the variable on all host in group mysql
This is the code in the template
{% for host in grou
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:
>>
>> ansible-playbook
On 05.11.2018 15:08, Uwe Sauter wrote:
Because he was running the playbook with this commandline:
ansible-playbook -i infra --limit mysql04 main.yml --tags "mysql" -vvv
There you have the problem.
He has template code that read variable from all the host in group mysql
and running the command
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 to
On 04.11.2018 23:50, Tom K. wrote:
Hey Uwe,
I hear you and apologies. Was trying to keep it from getting too messy
since the output is large.
Link to file is
here: http://microdevsys.com/ansible/ansible-vvv.out.txt.gz
Just the same, in case you can't get to the file, here's the first 100
lin
Hey Uwe,
I hear you and apologies. Was trying to keep it from getting too messy
since the output is large.
Link to file is
here: http://microdevsys.com/ansible/ansible-vvv.out.txt.gz
Just the same, in case you can't get to the file, here's the first 100
lines:
TASK [mysql : Print a
Does the first line of /tmp/test.out contain the correct IP address? If so,
templating is working correctly.
Also please keep in mind that we are no mind readers and stripping away context to make output shorter usually doesn't
help. That said please provide the complete output of a run with -v
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@mysql04 tmp]# cat /tmp/test.out|grep -Ei an
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 follows:
>
> |
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 follows:
> >
> > |
> > # cat main.yml
> > ---
> >
> >
> > -name:Gatherall facts prior to execution
> >hosts:mysql
> >gather_facts:false
>
On Sunday, November 4, 2018 at 9:51:24 AM UTC-5, Uwe Sauter wrote:
>
> 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.
>
>
I did actually:
[root@mysql04 tmp]# ls -altri /tmp/ansible_default_*
ls
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 v
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 S
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 Tom
On Sunday, November 4, 2018 at 1:35:14 AM UTC-5, Vladimir Botka wrote:
>
> "HostVarsVars" looks suspicious in the error message. Where does it come
> from? Find it and check if this is what you want.
>
It only shows up in the output:
[root@awx01 ansible]# grep -EiR HostVarsVars *
[root@awx01 a
On Sunday, November 4, 2018 at 2:45:06 AM UTC-5, Uwe Sauter wrote:
>
> 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:Insta
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 ga
"HostVarsVars" looks suspicious in the error message. Where does it come
from? Find it and check if this is what you want.
'ansible.vars.hostvars.HostVarsVars object' has no attribute
'ansible_default_ipv4'
HTH,
-vlado
--
You received this message because you are subscribed to the Google Gro
Thanks Uwe!
# cat main.yml
---
- name: Gather all facts prior to execution
hosts: mysql
gather_facts: yes
- name: Install and configure MySQL
hosts: mysql
sudo: yes
roles:
- mysql
tags: mysql
The above calls this role:
# vi tasks/main.yml
# These tasks install the community M
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)
f
30 matches
Mail list logo