My goal is to fail early and warn if storage network not set up (and set up
mounts if it is set up).
I've an approach that seems to work OK, but was wondering if there is a
preferred/better path
set_fact:
has_storage_lan: '{{ ansible_all_ipv4_addresses|join()|match("10.0.20.")
}}'
This
Kai - Thank you very much. Everything you mentioned was exactly right.
Helped me learn a thing or two about proper syntax...and reminding me not
to code too late into the evening. haha.
Final Playbook:
---
- name: Target Host
hosts: "{{ target }}"
tasks:
- name: Register foo
command:
Hello,
I'm trying to get a role to run on all hosts except the last. I thought
this would work:
- { role: wait, timeout: 300, tags: ['wait'], when: inventory_hostname !=
> play_hosts[-1] }
...but I get a YAML syntax error.
Is there a way to do this?
Best,
- C
--
You received this
I think I've figured out what is causing the issue. I don't know what to do
solve the issue. Sudosh has been configured to only allow certain commands
via remote shell. On a test system running more or less the same setup I
can configure sudosh (/etc/sudosh.conf) to allow all commands. I don't
Actually no, the playbook is running as the ansible user so cannot read
those directories
Thanks
On Wed, Jul 12, 2017 at 2:26 PM, Kai Stian Olstad <
ansible-project+l...@olstad.com> wrote:
> On 12. juli 2017 20:11, Anfield wrote:
>
>> How would I get around this issue on the localhost? I
Hi Brian,
The command and output is below.
The thing that I find odd is that, to the best of my knowledge, ansible
uses the ssh client config of user by default. The same user that runs
ansible (root in this case) gets the correct username (not root) and SSH
key from ~/.ssh/config and is able to
On 12. juli 2017 20:11, Anfield wrote:
How would I get around this issue on the localhost? I tried adding
become_user: root and that didnt work either
It must be something with your setup.
Does this command work for the same user you are running
ansible-playbook with?
sudo cat
Copy the public keys into the playbook directory.
On 12 July 2017 at 19:11, Anfield wrote:
> How would I get around this issue on the localhost? I tried adding
> become_user: root and that didnt work either
>
>>
>
--
You received this message because you are subscribed
How would I get around this issue on the localhost? I tried adding
become_user: root and that didnt work either
>
--
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
No, inventory vars are always flattened to the host, 'all' is a way to
assign a variable to all hosts, but it is still 'host level'.
Use vars/vars_files or extra_vars instead.
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project"
It would help if you show the commands attempted and the full error,
even using -vvv to make the output verbose.
-
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails
bin/ansible is for Adhoc tasks, you want bin/ansible-playbook is for
executing playbooks
this makes no sense:
/usr/bin/ansible /home/ansibleuser/ansible/playbooks/ansible-playbook
device_bak_2.yml
I think you want:
/usr/bin/ansible-playbook /home/ansibleuser/ansible/playbooks/device_bak_2.yml
Hi,
I am attempting to schedule a playbook to run every night to backup Cisco
network device configs using crontab.
The playbook is a simple ios_command task executing show run on the Cisco
Devices.
The playbook works fine when I run it manually and I have got to the point
where crontab is
we usually perform lot of multipath tasks in our company.
On a server if i want to configure multipath for disk aliases
multipath -ll|egrep "dm-|size"|sed -e 's/\]/ /g'|sed -e 'N' -e 's/\n/
/'|awk '{print $6,$2}'|sed -e 's/\[size=//g'|sed -e 's/(//g'|sed -e
's/)//g'|sed -e 's/\.0G/G/'|sort
On 12. juli 2017 06:36, burns...@umn.edu wrote:
Why does this syntax work for debug but not set_fact? How can I actually
use the debug output on the other host?
Pure luck that the debug work and you yaml syntax is wrong of set_fact.
*Playbook:*
---
- name: Target Host
hosts: "{{ target
This is how I solved the problem in rsyslog.conf:
if $pri-text == 'user.notice' and $msg contains 'ansible' then {
/var/log/ansible.log
stop
}
I put this pretty close to the top of the rsyslog.conf, above GLOBAL
DIRECTIVES.
--
You received this message because you are subscribed to
Hi Dag,
Sorry about the late response. I was wondering how well used they are, how
stable and reliable the modules are considered to be. The background is
that my organisation is looking for a solution to migrate ACI provisioning
and I'd like to advocate Ansible as a possibility but would like
this is the maximum allocated run time set for the task
in your example:
- run the simulated long running task for a max of 45 s (in the case of
long running task, you do not want it to run for ever)
- poll status every 5 second (so every 5 seconds there is to check the
status like whether the
So is there no way to define something like 'global' variables along with
the inventory ? I thought the implicit 'all' group can be treated like
global variables.
On Tuesday, 11 July 2017 19:27:06 UTC+2, Brian Coca wrote:
>
> The 'hostList1' inventory variable is not available until AFTER the
I'm trying to run commands against a remote host and even a simple ad hoc
ping fails, with the error '"/bin/sh" isn\'t allowed to be executed'. The
error message changes to '/bin/bash' when I add "executable = /bin/bash" in
ansible.cfg. Adding the -b switch makes no difference. When looging in
Thanks Philippe,
"Poll - 0" means that never check the status as the connection will be
broken. What does "async - 1" means ?
Can you explain this example to me ?
- name: simulate long running op (15 sec), wait for up to 45 sec, poll every
5 sec
command: /bin/sleep 15
async: 45
21 matches
Mail list logo