Re: [ansible-project] Ansible - Environment variable

2020-02-21 Thread Sivaraman P
Is there any other way to do this? On Sat, 22 Feb 2020, 11:46 Dick Visser, wrote: > Not really, this is what I meant with that the solution is fragile. > > > On Fri, 21 Feb 2020 at 11:02, Sivaraman P wrote: > >> Now I am able to set the environment using the playbook you have sent. >> But I

Re: [ansible-project] Ansible - Environment variable

2020-02-21 Thread Dick Visser
Not really, this is what I meant with that the solution is fragile. On Fri, 21 Feb 2020 at 11:02, Sivaraman P wrote: > Now I am able to set the environment using the playbook you have sent. But > I Have one more problem in this. The file that I have contains variables > like below. As we are

[ansible-project] Building a VM using Ansible Tower

2020-02-21 Thread Sindhu Rao
I'm building a VM on Vcenter with a playbook that runs fine and creates a VM when executed from the Ansible server but fails to create a VM when the same playbook is executed from ANsible Tower. I do not see any syntax errors and I see the same job output on both the Ansible server and on

Re: [ansible-project] jump through two bastion hosts?

2020-02-21 Thread Kai Stian Olstad
On Wed, Feb 19, 2020 at 12:06:21PM -0800, 'Eric Hymowitz' via Ansible Project wrote: > So I've got a host that I need to jump through two bastion hosts to get to: > > Ansible -> bastion_1 -> bastion_2 -> target > > I can use ansible to get to bastion_2 by setting up a hostvar: > >

[ansible-project] Issue with openssl_csr authority_cert_issuer

2020-02-21 Thread Joshua Goldman
Hello, I am trying to specify O and CN authority_cert_issuer: 'dirName:O = Example Net, CN = example.net' authority_key_identifier: authority_cert_serial_number: x I get the following error on playbook run. "msg": "Cannot parse Subject

Re: [ansible-project] Templating error with Ansible 2.9 or higher

2020-02-21 Thread Hugo Gonzalez
On 2/19/20 8:02 AM, harry devine wrote: I'm using the Satellite6 Content Views role found here: https://galaxy.ansible.com/ahuffman/satellite6_manage_content_views. It works on Ansible up to 2.8.6, but any version after that gives the following error: TASK [satellite6_manage_content_views

Re: [ansible-project] Re: How to source a file which contains environment variables in a linux

2020-02-21 Thread Hugo Gonzalez
On 2/20/20 3:53 AM, Sivaraman P wrote: Gopi Krishna, Did you got any solution for this? Now I was in the same situation. I can expect that any statements executed within the same shell task will have access to the variables, but nowhere else in the system. What happens if you do the

[ansible-project] Migration off Tool Server to Admin Box on Citrix

2020-02-21 Thread Harris Humayun
Hello: I am a sys admin for a contractor in the govt. Where I work we have servers with tools on them, what I am tasked with doing is moving these tools over to an admin box on Citrix, so it can be accessed by VDI. I need to first find out how many users login to the servers, is there anyway I

Re: [ansible-project] Ansible delegate to another host

2020-02-21 Thread James Cassell
On Fri, Feb 21, 2020, at 1:33 PM, Amit Juneja wrote: > Hi everyone, > > I would appreciate if you could please look at my issue below and > provide your suggestions - > > GOAL - Identify if the data in lower environment is scrambled. > > Steps - > 1. Identify all lower environment and form

[ansible-project] Re: shell module failing for grep

2020-02-21 Thread Matt Zagrabelny
SOLVED. Ansible is using the root account, but dconf is using my user account. Sorry for the noise! -m On Fri, Feb 21, 2020 at 2:31 PM Matt Zagrabelny wrote: > > Greetings, > > I'm running ansible 2.9 (2.9.4+dfsg-1) and I've searched the mailing > list archives regarding this issue, but I

[ansible-project] shell module failing for grep

2020-02-21 Thread Matt Zagrabelny
Greetings, I'm running ansible 2.9 (2.9.4+dfsg-1) and I've searched the mailing list archives regarding this issue, but I haven't found out why I'm seeing what I am seeing. shell module is failing when I'm not expecting it to. I run this command manually on my system: $ dconf dump

[ansible-project] ansible - ios_config: suppress all the "show running-configs" that occur after updating each port on a cisco switch?

2020-02-21 Thread John Hawley
I have a playbook that steps through all the ports on a cisco switch stack, adding or removing lines and it takes a very long time to run. I can see in TACACS command accounting that it is doing a "show running-config" after each port modification. If I have a switch stack with (8) 48-port

Re: [ansible-project] Ansible delegate to another host

2020-02-21 Thread Stefan Hornburg (Racke)
On 2/21/20 7:33 PM, Amit Juneja wrote: > Hi everyone, > > I would appreciate if you could please look at my issue below and provide > your suggestions - > > GOAL - Identify if the data in lower environment is scrambled. > > Steps -  > 1. Identify all lower environment and form sql query of

[ansible-project] Ansible delegate to another host

2020-02-21 Thread Amit Juneja
Hi everyone, I would appreciate if you could please look at my issue below and provide your suggestions - GOAL - Identify if the data in lower environment is scrambled. Steps - 1. Identify all lower environment and form sql query of random records to run in PROD 2. Dynamically identify the

Re: [ansible-project] [ Ansible ] - How to comment (add #) all lines in file

2020-02-21 Thread Pawan Kumar
Vlado you are the champ 鷺 On Fri, 21 Feb 2020, 15:46 Vladimir Botka, wrote: > On Fri, 21 Feb 2020 08:48:33 + > João Santos wrote: > > > Indeed that suggestion worked out in replacement of using `shell` module > > (or similar). > > > > On Thu, 20 Feb 2020 at 18:53, Vladimir Botka wrote: >

[ansible-project] .ansible/tmp/ansible-tmp readonly file systems

2020-02-21 Thread Bill Mounsey
serverA | UNREACHABLE! => { "changed": false, "msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\".

Re: [ansible-project] [ Ansible ] - Read a properties file (java/springboot) to use later

2020-02-21 Thread Vladimir Botka
On Fri, 21 Feb 2020 13:15:59 + João Santos wrote: > Regarding ".splitlines()" and other functions that might not be > directly documented at Ansible webpages, for a newbie, how can I be able to > know which one are available to be used? See "String Methods". For example

Re: [ansible-project] [ Ansible ] - Read a properties file (java/springboot) to use later

2020-02-21 Thread João Santos
Vlado, your solution worked like a charm. Thank you once again and keep up the good work of sharing your insights/knowledge with community. On Fri, 21 Feb 2020 at 10:51, Vladimir Botka wrote: > On Fri, 21 Feb 2020 01:57:32 -0800 (PST) > João Santos wrote: > > > The properties file will

[ansible-project] Re: How to use an IF Else Statement with Ansible Playbook

2020-02-21 Thread David Foley
So i have updated the Script as follows: > --- > - hosts: localhost > gather_facts: false > tasks: > - vmware_guest_info: > hostname: > username: > password: > validate_certs: no > datacenter: Test > name: Win10 > schema: "vsphere" >

[ansible-project] Re: How to use an IF Else Statement with Ansible Playbook

2020-02-21 Thread David Foley
> > HI Davide > When i use when: vminfo["runtime.powerState"] == "poweredOn" Im Getting fatal: [localhost]: FAILED! => {"msg": "The conditional check 'vminfo[\"runtime.powerState\"] == \"poweredOn\"' failed. The error was: error while evaluating conditional

[ansible-project] Creating variables from register variable in ansible

2020-02-21 Thread Sivaraman P
I have the register variable which contains number of lines in stdout_lines. With those lines I have to create variables. Is there any workaround for this. Ex: register: output output.stdout_line contains below lines variable1: value1; variable2: variable1 + value2; variable3: variable2

Re: [ansible-project] How to use an IF Else Statement with Ansible Playbook

2020-02-21 Thread Davide Scrimieri
Please, don't do this. Register a variable and use the when condition. https://docs.ansible.com/ansible/latest/user_guide/playbooks_conditionals.html#the-when-statement On Fri, Feb 21, 2020 at 12:22 PM David Foley wrote: > Hi, > > Can Someone help with a IF Else Statment within Ansible. > > If

[ansible-project] How to use an IF Else Statement with Ansible Playbook

2020-02-21 Thread David Foley
Hi, Can Someone help with a IF Else Statment within Ansible. If i Run a a GetStatus Playbook the Register: vminfo outputs the Following: ok: [localhost] => { "vminfo": { "changed": false, "failed": false, "instance": { "runtime": {

Re: [ansible-project] [ Ansible ] - Read a properties file (java/springboot) to use later

2020-02-21 Thread Vladimir Botka
On Fri, 21 Feb 2020 01:57:32 -0800 (PST) João Santos wrote: > The properties file will havethis layout as an example: > > sw01.local.protocol=${proto} > sw01.local.host=${host} > sw01.local.user=${user} > > sw02.local.protocol=${proto} > sw02.local.host=${host} > sw02.local.user=${user} > >

Re: [ansible-project] [ Ansible ] - How to comment (add #) all lines in file

2020-02-21 Thread Vladimir Botka
On Fri, 21 Feb 2020 08:48:33 + João Santos wrote: > Indeed that suggestion worked out in replacement of using `shell` module > (or similar). > > On Thu, 20 Feb 2020 at 18:53, Vladimir Botka wrote: > > > > Use "replace" module. For example > > > >

Re: [ansible-project] Ansible - Environment variable

2020-02-21 Thread Sivaraman P
Now I am able to set the environment using the playbook you have sent. But I Have one more problem in this. The file that I have contains variables like below. As we are reading the file and setting the environment, the values are not passing correctly, Is there any workaround for that?

[ansible-project] [ Ansible ] - Read a properties file (java/springboot) to use later

2020-02-21 Thread João Santos
Hey all, Would like to count with your experience/feedback with a very specific task... I would like to collect the content of a properties file (java/springboot) and turn it to a form of data structure to later use it during playbook execution. The properties file will havethis layout as an

Re: [ansible-project] [ Ansible ] - How to comment (add #) all lines in file

2020-02-21 Thread João Santos
Hi, thanks for the reply. Indeed that suggestion worked out in replacement of using `shell` module (or similar). Thanks for sharing. On Thu, 20 Feb 2020 at 18:53, Vladimir Botka wrote: > On Thu, 20 Feb 2020 09:25:26 -0800 (PST) > João Santos wrote: > > >- I have a file and want to insert

[ansible-project] Re: Unable to create the new dashboard : 404 messageDashboard not found

2020-02-21 Thread Ferry Bodijn
When your JSON file contain a id field, Grafana API will search for a dashboard with this id, and if it does not exists it return a 404. Hence delete this from your JSON file and run your playbook. Op woensdag 8 januari 2020 14:35:09 UTC+1 schreef anilkumar panditi: > > I am trying to import a