Hi all,
If I want to use the result of a command within a template I use
`register`:
- name: gather some facts
command: ls -l /etc
register: etc_contents
and then, in my template:
# {{ ansible_managed }}
{% for d in etc_contents.stdout_lines %}
{{d}}
{% endfor %}
It works OK, but it would b
Great, that works. And with $F[5] we also get the home directory for each
user. So I'll see if I can turn that into a default playbook for general us
as Michael DeHaan suggested.
Am Montag, 9. Dezember 2013 21:31:32 UTC+1 schrieb Kahlil Hodgson:
>
> On 9 December 2013 19:51, Jürgen Haas >
> wro
Hey,
Den måndagen den 9:e december 2013 kl. 15:34:53 UTC+1 skrev Michael DeHaan:
>
> We're not going to move anything at this time.
>
Aight. It's your call.
> I think you can get used to it.
>
Sure, and the next thousand users can too. ;-) I'm not thinking of me, but
more them.
Cheers,
Jen
Sweet! Thanks!
Den måndagen den 9:e december 2013 kl. 15:35:33 UTC+1 skrev Michael DeHaan:
>
> Yep, here's an example!
>
>
> https://github.com/ansible/ansible-examples/blob/master/lamp_haproxy/rolling_update.yml
>
>
>
> On Mon, Dec 9, 2013 at 6:42 AM, Jens Rantil
> > wrote:
>
>> Good day,
>>
>>
Hi,
I never did anything with Jinja before, now I want to create my first
template. :)
Is there an easy way to test my template locally?
Like on the command line with the variable as options?
i.e.
# jinja-test mytemplate.js special=yes proxy=foo
# cat mytemplate.js
proxy={{ proxy }}
{% if
Here is the Ansible role on github.com:
https://github.com/jurgenhaas/ansible-user-management
It can be executed as a role, e.g. like this:
- name: "Manage Users"
hosts: "all"
connection: ssh
gather_facts: false
sudo: yes
roles:
- users
Enjoy!
My plan is to further enhance that r
just use local_action: template, with the playbook and save it to a tmp
dir, then you can examine it.
also --check and --diff do a good job of showing you what you would put
into place with template module.
--
You received this message because you are subscribed to the Google Groups
"Ansible P
No one else has had a problem.
--
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
to ansible-project+unsubscr...@googlegroups.com.
For more options, visit https://
Hello community,
I have made simple nginx, symfony, php ansible playbook. Playbook runs fine
both with Vagrant and with "real server".
Problem is when I change some config values, eg. nginx http port, and re
run playbook, the change occurs on the server but handler doesnt run and my
web serve
So without seeing your playbook there is very very little we can tell about
what's going on.
Perhaps you could upload to the relevant parts to gist or share snippets.
On Tue, Dec 10, 2013 at 10:27 AM, Marko Lisica wrote:
> Hello community,
>
> I have made simple nginx, symfony, php ansible pl
I'll file a ticket to add this to the suggester code, thanks!
On Mon, Dec 9, 2013 at 10:00 PM, wrote:
> Thank you. Quoting resolves the issue. But I want to say, indeed, the rest
> of the output didn't tell me what to do. :)
> The whole output is:
> ERROR: Syntax Error while loading YAML script
So, this is an old post, so I have an update for you.
You can already get a fair measure of this if you are an AWX user, here to
launch a few Job Templates by ID:
awx-cli joblaunch -t 0 && awx-cli joblaunch -t 1
This also gives you central status logging and access control -- delegation
around w
You can definitely pass in with_items with a list of hashes.
module_name: foo={{ item.name }} bar={{ item.value }}
with_items:
- { name: 'x', value: 'y' }
- { name: 'a', value: 'b' }
etc
or with_items: alist_of_hashes
etc
or as you have it, with
with_items: [ { name: 'x', value: 'y' },
Are you seeing otherwise?
On Tue, Dec 10, 2013 at 12:20 AM, TextEditor wrote:
> So when I do a remount of root (/) with new options it will be made
> permanent in fstab?
>
> Op maandag 9 december 2013 15:37:21 UTC+1 schreef Michael DeHaan:
>>
>> Also note the description of the module
>>
>> "
Wow, somehow I totally missed this reply. Thank you for responding. Sorry
for the terrible formatting of my post. I'll consider your suggestion and
update this thread once I have an answer. Again, very strange that it works
fine when I leave the module on the server, login there, and execute it
Is this currently possible with Ansibles pip module? I have been googling
and trying different ways all morning but come up empty handed.
Say I want to install the latest 1.2 version of a specific package with
pip, but not 1.3.x versions due to compatibility issues. Manually I could
run:
>
Using Vagrant to spin up dev environments promises to end many of our
cross-platform server-side development issues once and for all. When
deciding how to provision my vagrant boxes, I considered Chef, Puppet, and
Ansible. I settled on Ansible for reasons that are obvious to this group's
read
Folks, The following code is producing errors.
code:
{% for v in hostvars.iteritems() %}
{{ v['ansible_all_ipv4_addresses'][0] }} {{ v['ansible_hostname'] }}
{% endfor %}
error:
{'msg': "One or more undefined variables: 'tuple object' has no attribute
'ansible_all_ipv4_addresses'", 'fai
Thanks for this fix! I ran into this issue when running ansible-playbook as
part of a shell provisioning script in Vagrant. In other words, Vagrant is
just running a shell script, and the shell script is running "sudo
ansible-playbook" in local mode. However, I just wanted to point out that
in
Hello all,
I tried to install Ansible on both Mac OS X 10.9 and ubuntu-12.04.
It seems my installation on OS X is not quite complete.
I followed the instructions on this page below:
http://www.ansibleworks.com/docs/intro_installation.html
If I installed Ansible by using this script below on ubu
Folks, The following code is producing errors.
code:
{% for v in hostvars.iteritems() %}
{{ v['ansible_all_ipv4_addresses'][0] }} {{ v['ansible_hostname'] }}
{% endfor %}
error:
{'msg': "One or more undefined variables: 'tuple object' has no attribute
'ansible_all_ipv4_addresses'", 'fai
On 12/10/2013 11:24 AM, Vasiliy Boulytchev wrote:
Folks, The following code is producing errors.
code:
|{% for v in hostvars.iteritems() %}
{{ v['ansible_all_ipv4_addresses'][0] }} {{ v['ansible_hostname'] }}
{% endfor %}
|
error:
|{'msg': "One or more undefined variables: 'tuple objec
Did this ever get addressed in Vagrant?
On Mon, Dec 9, 2013 at 4:01 PM, Taylor Brown wrote:
> Thanks for this fix! I ran into this issue when running ansible-playbook
> as part of a shell provisioning script in Vagrant. In other words, Vagrant
> is just running a shell script, and the shell s
The current development branch head is labelled 1.5 and is not yet released.
If you run the "I want to run it from checkout" script it's not going to
install any files, but you can find an example configuration file in the
examples/ dir of the checkout.
You can also install using pip or homebrew.
Yep, it was resolved in Vagrant 1.3.4.
On 10 Dec 2013 17:33, "Michael DeHaan" wrote:
> Did this ever get addressed in Vagrant?
>
>
>
>
> On Mon, Dec 9, 2013 at 4:01 PM, Taylor Brown wrote:
>
>> Thanks for this fix! I ran into this issue when running ansible-playbook
>> as part of a shell provisi
On 12/09/2013 03:05 PM, Ye Deng wrote:
Hello all,
I tried to install Ansible on both Mac OS X 10.9 and ubuntu-12.04.
It seems my installation on OS X is not quite complete.
I followed the instructions on this page below:
http://www.ansibleworks.com/docs/intro_installation.html
If I installed An
You could use the pip module with a requirements.txt.
I do agree version should be specified in the version parameter.
I do welcome attempts to upgrade the module, should you wish to try!
On Tue, Dec 10, 2013 at 5:23 AM, Gustav Andersson <
gustav.k.anders...@gmail.com> wrote:
> Is this curren
On 12/10/2013 11:54 AM, Vasiliy Boulytchev wrote:
Folks, The following code is producing errors.
code:
|{% for v in hostvars.iteritems() %}
{{ v['ansible_all_ipv4_addresses'][0] }} {{ v['ansible_hostname'] }}
{% endfor %}
|
error:
|{'msg': "One or more undefined variables: 'tuple objec
To avoid confusing the list, I'll clarify.
So in this case you're asking about running Ansible from Windows hosts
against Linux hosts.
This is not talking about using Ansible to configure Windows hosts (future
roadmap feature) and absolutely we are not going to ask anyone to install
sshd on a Win
On 12/10/2013 12:01 PM, Adam Williams wrote:
Wow, somehow I totally missed this reply. Thank you for responding.
Sorry for the terrible formatting of my post. I'll consider your
suggestion and update this thread once I have an answer. Again, very
strange that it works fine when I leave the modu
James,
The following is breaking as well:
{% for k,v in hostvars.iteritems() %}
{{ v['ansible_all_ipv4_addresses'][0] }} {{ v['ansible_hostname']
}}
{% endfor %}
On Tuesday, December 10, 2013 12:11:15 PM UTC-5, James Tanner wrote:
>
> On 12/10/2013 11:24 AM, Vasiliy Boulytchev wrote:
why not spin up the first vagrant box with ansible and control the rest
from there?
--
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
to ansible-project+unsubscr..
Michael DeHaan writes:
> You can definitely pass in with_items with a list of hashes.
>
> module_name: foo={{ item.name }} bar={{ item.value }}
> with_items:
>- { name: 'x', value: 'y' }
>- { name: 'a', value: 'b' }
>
> etc
>
> or with_items: alist_of_hashes
>
> etc
>
> or as you have it,
On 12/10/2013 12:44 PM, Vasiliy Boulytchev wrote:
James,
The following is breaking as well:
{% for k,v in hostvars.iteritems() %}
{{ v['ansible_all_ipv4_addresses'][0] }} {{
v['ansible_hostname'] }}
{% endfor %}
On Tuesday, December 10, 2013 12:11:15 PM UTC-5, James Tanner wrote:
Are you gathering facts?
Do those facts show ansible_all_ipv4_addresses? This is not present on all
distros, for example fails to populate on my gentoo machines.
ansible -m setup |less, will give you a full view of supported
facts on the target.
--
You received this message because you are sub
Facts are being gathered:
GATHERING FACTS ***
ok: [foo.us-west-2.compute.internal]
ok: [bar.us-west-2.compute.internal]
ok: [baz.us-west-2.compute.internal]
On Tuesday, December 10, 2013 11:24:52 AM UTC-5, Vasiliy Boulytchev wrote:
>
On 12/10/2013 01:02 PM, Vasiliy Boulytchev wrote:
Facts are being gathered:
GATHERING FACTS ***
ok: [foo.us-west-2.compute.internal]
ok: [bar.us-west-2.compute.internal]
ok: [baz.us-west-2.compute.internal]
On Tuesday, December 10, 20
Both
u'ansible_hostname': u'ip-10-72-97-33'
u'ansible_all_ipv4_addresses': [u'10.72.97.33']
are present...
On Tuesday, December 10, 2013 1:05:23 PM UTC-5, James Tanner wrote:
>
> On 12/10/2013 01:02 PM, Vasiliy Boulytchev wrote:
>
> Facts are being gathered:
>
> GATHERING FACTS
>
On 12/10/2013 01:31 PM, Vasiliy Boulytchev wrote:
Both
u'ansible_hostname': u'ip-10-72-97-33'
u'ansible_all_ipv4_addresses': [u'10.72.97.33']
are present...
On Tuesday, December 10, 2013 1:05:23 PM UTC-5, James Tanner wrote:
On 12/10/2013 01:02 PM, Vasiliy Boulytchev wrote:
Facts are
Hi, actually I didnt quite understand notify function. I had notify for
nginx restart once in my playbook, the thing I didnt understood is that
NOTIFY has to be present in every task that will be changed sometiomes in
the future and in every task that needs some action I have to put notify.
B
Absolutely. The keys are present.
I've been able to narrow it down to the following:
work:
{% for k,v in hostvars.iteritems() %}
{{ v['ansible_all_ipv4_addresses'] }} {{ v['ansible_hostname'] }}
{% endfor %}
doesnt:
{% for k,v in hostvars.iteritems() %}
{{ v['ansible_all
On 12/10/2013 02:23 PM, Vasiliy Boulytchev wrote:
Absolutely. The keys are present.
I've been able to narrow it down to the following:
work:
{% for k,v in hostvars.iteritems() %}
{{ v['ansible_all_ipv4_addresses'] }} {{ v['ansible_hostname'] }}
{% endfor %}
doesnt:
{% for k,v
Is this a bug (ansible 1.4):
- name: add user toto
mysql_user: name=toto host='%' password='p455w0rd' priv="somedb:ALL"
It works, it does the right thing, but when I run it with the "priv=" that
status is always "changed". If I remove the priv, the status is "ok".
--
Yves.
--
You
I'm doing something like this
tasks:
- lineinfile: dest={{ item[0] }}/.gitignore create=yes regexp='{{
item[1] }}' line='*.{{ item[1] }}'
with_nested:
- [ '/tmp/foo', '/tmp/bar' ]
- [ 'lck', 'log', 'Log' ]
but then I want to do other operations on the same list o
I am curious if there is any mechanism to perform synchronous tasks among a
group of nodes (or nodes in a role, etc.)
There is one example online to perform rolling updates to a group of web
servers, one at a time. This makes perfect sense, since in this case you
don't want to shut down all of
- hosts: webnodes
tasks:
- shutdown
- hosts: db
tasks:
- migration
- hosts: webnodes
tasks:
- upgrade
... you can see where I'm going
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop
forgot the last:
- hsots: webnodes
serial: 1
tasks:
- startup
--
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
to ansible-project+unsubscr...@googlegroup
I am new to ansible, obviously :-)
How are we defining "shutdown" task? Should that be under a role?
On Tuesday, December 10, 2013 3:22:22 PM UTC-5, Brian Coca wrote:
>
> - hosts: webnodes
> tasks:
> - shutdown
>
> - hosts: db
> tasks:
>- migration
>
> - hosts: webnodes
> tasks:
>
it was just a placeholder for however you manage the webnodes, in my case
it is:
service: name=nginx state=stopped
that should work for anything that uses the system's init apps
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe
On 12/10/2013 03:15 PM, Yves Dorfsman wrote:
Is this a bug (ansible 1.4):
- name: add user toto
mysql_user: name=toto host='%' password='p455w0rd'
priv="somedb:ALL"
It works, it does the right thing, but when I run it with the "priv="
that status is always "changed". If I remove t
On 12/10/2013 03:17 PM, Michael Baydoun wrote:
I'm doing something like this
tasks:
- lineinfile: dest={{ item[0] }}/.gitignore create=yes regexp='{{
item[1] }}' line='*.{{ item[1] }}'
with_nested:
- [ '/tmp/foo', '/tmp/bar' ]
- [ 'lck', 'log', 'Log' ]
but the
>
>
>
> Are you looking for a quicker way to reference those items than having
> to type out the lists over and over again?
>
>
>
yes, I want to specify the array of directories 1 time in 1 place, and not
repeat and maintain multiple identical arrays.
after the infile module for example, I want
Re-using old thread.
I have something like this:
- name: Check-out latest Wordpress Skeleton
copy: src=/etc/ansible/roles/web/files/WordPress-Skeleton/
dest=/data/public/{{ customer }}/test owner={{ httpd-user }} group={{
httpd-user }}
tags: wordpress
As per notes:
Local path to a file to
I have a situation where I have files locateed in /files (top-level) and
would like to use them within certain roles to avoid duplication. However
ansible tells me it can't find referenced file. Do I need to turn a knob
or should I just copy same files into diff roles or for any common files
you have a dash in your variable name {{ httpd-user }}. try using an
underscore instead and that error shouldn't happen!
http://www.ansibleworks.com/docs/playbooks_variables.html#what-makes-a-valid-variable-name
matt
On Tue, Dec 10, 2013 at 4:14 PM, Guillem Liarte <
guillem.lia...@googlemail.
The recursive copy functionality was added for 1.4. The current version of
ansible is 1.4.1.
I would recommend upgrading.
On Tuesday, December 10, 2013, Guillem Liarte wrote:
> Re-using old thread.
>
> I have something like this:
>
> - name: Check-out latest Wordpress Skeleton
> copy: src=/et
Is there a solution to this?
I am trying to add to PATH and can't keep ansible from evaluating a $
I've tried '\$' and several other things.
I'm trying to achieve the following:
MYPATH is an env variable on a remote host.
I want to add a string defined in vars/main.yml to a line in .bash_profil
On 11 December 2013 08:48, Kesten Broughton
wrote:
> path_to_git_extras: 'PATH=\\$PATH:\\$ANSIBLE_21CT_HOME/roles/git/files'
>
does '>' quoting help?
path_to_git_extras: >
PATH=$PATH:$ANSIBLE_21CT_HOME/roles/git/files
K
--
You received this message because you are subscribed to th
On 2013-12-10 13:31, James Tanner wrote:
On 12/10/2013 03:15 PM, Yves Dorfsman wrote:
Is this a bug (ansible 1.4):
- name: add user toto
mysql_user: name=toto host='%' password='p455w0rd' priv="somedb:ALL"
It works, it does the right thing, but when I run it with the "priv=" that
st
Another approach occurs that does not require the Perl Crazy Glue:
- name: grab passwd entries for this host
shell: cat /etc/passwd'
register: passwd
- name: lock unknown users
user: name={{ item.split(':').0 }} password='!!'
when: item.split(':').0 not in known_users
and item.split(
On 12/10/2013 05:09 PM, Yves Dorfsman wrote:
On 2013-12-10 13:31, James Tanner wrote:
On 12/10/2013 03:15 PM, Yves Dorfsman wrote:
Is this a bug (ansible 1.4):
- name: add user toto
mysql_user: name=toto host='%' password='p455w0rd'
priv="somedb:ALL"
It works, it does the right t
and by the way, comments like "but it is little things like that making it
look like not mature enough" are not going to incite a lot of people to
help you :-) Ansible is very useful to a lot of people (like myself), and
like any project, it has room for improvement and as an open source
project, i
Ansible's currently the most popular automation tool on github in terms of
watchers and forks, so it will take more than that to break my bones.
However, yes, it wasn't very appreciated.
Please file a bug if you have a bug to report and are running the latest
released version.
On Tue, Dec 10
Hi all,
A recent discussion on the development list introduced some great patches
from Jerome Wagner, which have streamlined the number of SSH operations
Ansible has to perform for a certain class of tasks. This makes the ssh
implementation even faster (and especially so with Control Persist on,
Ok this was breaking async, we will get it working shortly!
On Tue, Dec 10, 2013 at 6:52 PM, Michael DeHaan wrote:
> Hi all,
>
> A recent discussion on the development list introduced some great patches
> from Jerome Wagner, which have streamlined the number of SSH operations
> Ansible has to
I have defined three roles: A, B and C.
Using meta/main.yml, I have B depending on A, and C depending on A as well.
If I have the following:
- hosts: group_test
roles:
- B
- C
What happens is that the tasks associated to role A is executed twice. Is
there any dedup mechanism to exe
I used the shell provisioner to launch a script that setup Ansible and then
used Ansible in pull mode.
IIRC I was able to issue management commands via vagrant ssh (ie from
Windows command prompt).
On Monday, December 9, 2013 8:51:07 AM UTC-6, Taylor Brown wrote:
>
>
>
> Using Vagrant to spin
Hi Xu -
Not that I have seen. I believe you will have duplicate tasks run.
John
On Tuesday, December 10, 2013 at 9:20 PM, Xu Chen wrote:
> I have defined three roles: A, B and C.
>
> Using meta/main.yml, I have B depending on A, and C depending on A as well.
>
> If I have the following:
>
68 matches
Mail list logo