I wrote a playbook to collect CPU/RAM/HDD info in ansible using command
"inxi"
- name: run inxi to collect Ubuntu/Debian hardware info
> become: yes
> become_method: sudo
> shell: "/usr/local/bin/inxi -c -Dxx -C -m"
> register: du_hw_info
> when: ansible_distribution == "Ubuntu" or
Hello,
I'm using the ios_facts module and trying to retrieve the configuration
from a Cisco CSR1000v. The configuration seems to be saved ok but the top
of the file contains two lines that are invalid configuration commands.
Thus, this file cannot be loaded into a router "as-is". The two
Ansible CANNOT read the files on the remote as part of the playbook,
you need to either check them out on the controller (git +
delegate_to: localhost) or 'fetch' them via the module with the same
name.
AWX will just checkout that repo onto the AWX machine and run Ansible
'locally' on those
The copy module itself does not copy across machines, only on the same
machine, as I said, the connection itself does the copy from
controller to target (temp location) then executes the 'copy module'
against that temp location (unless remote_src=true in which case copy
module does all the work).
depends on what you mean, you cannot read the key value from Hashicorp
Vault into that variable, since that variable expects a path. You CAN
write the key into a file from the H Vault and then pass that path
into the variable.
--
--
Brian Coca
--
You received this message because you
They were never meant to work in inventory, they are used to 'select
FROM inventory' but not to define it.
See group_by and 'constructed' inventory plugin instead.
--
--
Brian Coca
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To
Well, scripts are used via the 'script' plugin, so you are already
using plugins. Scripts are very easy to create, they just need to
output properly formatted JSON, but the problem with scripts, is that
the are externally executed and cannot use facilities (like vault)
that Ansible provides.
Create a template that formats it nicely and use:
body: '{{lookup("template", "pretty_email.j2")}}'
You could try to do the same inline, but it ends up making the task
hard to read and update.
--
--
Brian Coca
--
You received this message because you are subscribed to the Google
you don't give enough info, what is template-vars.yml? how do you load it?
In any case, any solution is predicated on variable precedence, which
is documented here:
https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable
--
You also have {{playbook_dir}} but there is no 'project' concept in Ansible.
An approach I've used before is to define in 'group_vars/all.yml'
something like:
project_dir: '{{lookup("env", "MYPROJ")|default(playbook_dir)}}'
--
--
Brian Coca
--
You received this message because you
All template results default to unicode strings, this is something
Jinja2 does by default., but this is probably something we should fix
in the telnet plugin by forcing port to always be an int.
I'm unsure why telnet lib does not take a 'unicode string' as a 'string'.
--
--
Brian Coca
Mustaches don't stack,
when: ((domainName == "AD1") or (domainName == "AD2")) <= no
mustaches needed when 'when:', you are trying to do double
interpolation (conditionals have implicit {{ }})
Also you probably want to use 'in' instead of multiple comparisons:
when: domainName in ["AD1",
mysequence: "{{range(0, groups['Test']|length + 1)|list }}"
--
--
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 from it, send an email
to
To connect to windows from ansible you can use wintm instead of the default
winrm connection type
--
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
You can connect using either ssh key or username / password
--
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.
To
One solution is use ansible-vault to decrypt the file and export the variable
and have Jenkins read from the env var
--
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
Hi,
For most of the stuff it's just using the uri module, with something like
this:
name: "execute command: {{ exec.meta.description }}"
uri:
method: "{{ exec.meta.method }}"
url: "https://{{ a10_device_ip }}{{ exec.meta.uri }}"
return_content: true
validate_certs: no
body_format: "{{
I want to use inventory host groups length of hosts and inventory host group
vars .
For ex.
[Test]
Host0
Host1
Host2
Host3
Host4
[Test: vars]
Port=1223
Based on length of test group
I want to generate a sequence like this
0,1,2,3,4
Can someone please suggest how can I achieve this Inside a
Gotcha so does that mean you use Python scripts to leverage the A10 API, or do
you somehow integrate Ansible with Python?
Sent from my iPhone
> On Apr 22, 2019, at 6:07 PM, Pshem Kowalczyk wrote:
>
> Hi,
>
> We use the A10s. Those modules turned out to be not particularly useful for
> us,
Hello,
I am running into an issue, this is simple playbook which tries to copy
right config file based on Domain name, I tried executing below code
snippet it's skipping the non prod and executing prod, Not sure whats wrong
here, can some one throw a light here.
- name: Gathering facts
Hi,
We use the A10s. Those modules turned out to be not particularly useful for
us, so we ended up using the API extensively to get information (both
config and operational) from the devices.
kind regards
Pshem
On Tue, 23 Apr 2019 at 04:24, David Carrasco wrote:
> I am very new to both
Hi Community,
I'm facing some very basic problem. I'm trying to run open telnet session
with a device. However, when I'm filling the port dynamically using jinja
template, the port is passed as unicode thus I get the following error:
error: getaddrinfo() argument 2 must be integer or string
The first thing you want to do is create an inventory with a Windows group
that contains the generic WinRM connection vars like;
[windows]
[windows:vars]
ansible_connection=winrm
ansible_port=5986
ansible_winrm_transport=ntlm
ansible_winrm_server_cert_validation=ignore
This group is empty as
also should mention , I am looking for two node RAC installation using ASM
On Monday, April 22, 2019 at 3:18:49 PM UTC-4, Ahmad S wrote:
>
> I could not find a working example for this , can someone post a clear
> project code ? I found few web links but the Git repository does not
> match
I could not find a working example for this , can someone post a clear
project code ? I found few web links but the Git repository does not
match the instructions.
thanks
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe
I am very new to both Ansible and A10, but it's interesting to come across
an article written 5 years ago of someone who already went down this road.
I'm using the A10 in a network capacity (DDoS appliance) I was curious if
there was any way to display or output "get_facts" or show commands. At
check this link it worked with me
https://github.com/cmprescott/ansible-xml/issues/95
بتاريخ الأربعاء، 28 مارس، 2018 7:26:14 ص UTC+2، كتب Uvindra Dias Jayasinha:
>
> Im using Ansible 2.5 on Ubuntu 17.10
>
> Given the following xml file
>
>
>
>
>
>
>
> Trying to add nested elements so
check this it worked with me
https://github.com/cmprescott/ansible-xml/issues/95
بتاريخ الجمعة، 30 مارس، 2018 6:55:21 ص UTC+2، كتب Uvindra Dias Jayasinha:
>
> Thanks Kai
>
> On Wednesday, March 28, 2018 at 6:36:58 PM UTC+5:30, Kai Stian Olstad
> wrote:
>>
>> On Wednesday, 28 March 2018
Hi Team,
I am using ansible vault to encrypt an string and place the string in a
file called vault.yml
somthing like
name1: value1 where value1 is an encrypted string.
dbUser: PlainUser
dbPasswd: vault |
$ANSIBLE_VAULT;1.1;AES256
You could upload all these files (playbook, inventory, sample file to copy,
etc) to a temporary GitHub.com or GitLab.com repository for us to look at
it. The "unable to parse inventory" probably means formatting or other
weirdness, not a bug or problem with Ansible.
On Monday, April 22, 2019
Hi,
I tried changing the format of the inventory but still the same issue. Not
sure what else to be done. I mentioned all the necessary modules for
windows connection.
Do you anything to suggest here?
Thanks in Advance.
On Thursday, April 18, 2019 at 6:41:08 PM UTC+5:30, d...@linder.org
Further, to customize this.
I now have the ping module output for target hosts.
Now haw can i decide result code in the ping output.
Like eg, if A(some string) is present in the ping output then Register RC
= x
if B(some string) is present in the ping output then Register RC =y
these
32 matches
Mail list logo