[ansible-project] Adding body: to uri: task results in Status code was -1 and not [200]: An unknown error occurred: unhashable type

2020-02-11 Thread Stephen Elves
Hi, Tearing what little hair I have left: This is the fragment of the playbook: - name: create new RE if RE doesn't exist uri: url: https://api.eu.cloud.talend.com/tmc/v1.3/runtimes/remote-engines method: POST headers: Authorization: Basic {{talend_personal_access_token}} Accept:

[ansible-project] use rules from different git repos/locations

2020-02-11 Thread sanctc
Hi Folks, Can I use roles from several different git repos/locations to single ansible? e.g. --- - hosts: myhost roles: - role1: '/path/to/my/roles/common' - role2: '/usr1/to/my/roles/client' - role3: '/usrpath/to/my/roles/server' What would be the best way to use roles from

[ansible-project] Use rules from different git repo

2020-02-11 Thread Santosh Behera
Hi Folks, Can I use rules from several different git repo/location to single ansible? e.g. --- - hosts: myhost roles: - role1: '/path/to/my/roles/common' - role2: '/usr1/to/my/roles/client' - role3: '/usrpath/to/my/roles/server' What would be the best way to use roles from

[ansible-project] Ansible Vault online tool for encrypt/decrypt

2020-02-11 Thread Mamed Shahmaliyev
Dear Ansible users, recently i have been looking for some online service for on-hand ansible vault encrypt decrypt service and could not find anything. So i decided to write my own web interface: https://ansible-vault-tool.com/ Here you can decrypt or encrypt anything and no data is stored or

[ansible-project] Re: how can i have my windows instances to use IP address instead of dns name?

2020-02-11 Thread Work-Hard
okay thank you On Monday, February 10, 2020 at 6:26:03 PM UTC-8, Jordan Borean wrote: > > Just set the connection to use IPs as you would Linux it should just work. > Without seeing the error that you are receiving we can't help you anymore. > The most common reason why it doesn't is if you are

Re: [ansible-project] How to get clean output ?

2020-02-11 Thread Vladimir Botka
On Tue, 11 Feb 2020 14:59:04 -0800 (PST) Anand Solomon wrote: > Instead of maintaining another template file. Can I embed the content in > the playbook itself ? Sure you can. Put it into the "content". For example - local_action: copy dest=/scratch/tmp/revoke.sql

Re: [ansible-project] How to get clean output ?

2020-02-11 Thread Anand Solomon
Instead of maintaining another template file. Can I embed the content in the playbook itself ? On Tuesday, February 11, 2020 at 5:57:09 PM UTC-5, Anand Solomon wrote: > > Thank you so much Vlado. This works fine. > > On Tuesday, February 11, 2020 at 5:40:05 PM UTC-5, Vladimir Botka wrote: >> >>

Re: [ansible-project] How to get clean output ?

2020-02-11 Thread Anand Solomon
Thank you so much Vlado. This works fine. On Tuesday, February 11, 2020 at 5:40:05 PM UTC-5, Vladimir Botka wrote: > > On Tue, 11 Feb 2020 14:02:45 -0800 (PST) > Anand Solomon > wrote: > > > I need to get this > > Revoke EXECUTE on UTL_FILE from TESTACC1; Revoke EXECUTE on UTL_FILE > from >

Re: [ansible-project] How to get clean output ?

2020-02-11 Thread Vladimir Botka
On Tue, 11 Feb 2020 14:02:45 -0800 (PST) Anand Solomon wrote: > I need to get this > Revoke EXECUTE on UTL_FILE from TESTACC1; Revoke EXECUTE on UTL_FILE from > TESTACC2; To keep the element of the list in one line change the template. For example $ cat revoke.sql.j2 {% for line in

Re: [ansible-project] How to get clean output ?

2020-02-11 Thread Vladimir Botka
On Tue, 11 Feb 2020 14:02:45 -0800 (PST) Anand Solomon wrote: > "msg": { > "ansible_facts": { > "discovered_interpreter_python": "/usr/bin/python" > }, > "changed": false, > "failed": false, > "msg": [ > [ >

Re: [ansible-project] How to get clean output ?

2020-02-11 Thread Anand Solomon
Thanks Hugo for helping me. Basically I am running a sql command that runs a sql query which gives the below results. (this is a debug out) "msg": { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": false,

Re: [ansible-project] How to get clean output ?

2020-02-11 Thread Hugo Gonzalez
Without knowing anything about how you got those values, it would be {{ query_result.msg | join(' ') }} Hugo G. If I do     - local_action:         copy content={{query_result.msg}} dest=/home/ansible/Playbooks/{{sname}}/sql/revoke.sql I am getting [["Revoke

Re: [ansible-project] When var1 == "yes" and var2 == "no"

2020-02-11 Thread Hugo Gonzalez
On 2/11/20 11:44 AM, Jesse Lyon wrote: So, I'm having fits with when conditionals matching strings No matter what I do, it applies each conditional, the combination of the variables doesn't seem to count for ... anything. what the heck am I doing wrong? additionally, is there a better way

Re: [ansible-project] How do I include another playbook in current playbook?

2020-02-11 Thread Xinhuan Zheng
Hello Alicia, This is great. I got the idea. Thanks for your help! - Xinhuan On Thursday, January 23, 2020 at 12:33:57 PM UTC-5, alicia wrote: > > You cannot import a playbook anywhere inside a play - importing a playbook > is a play of its own. > > If you want to run the imported playbook

[ansible-project] How to get clean output ?

2020-02-11 Thread Anand Solomon
Hi, How will I get only the sql statement from the json output ? I am registering this as " register: query_result" Here is my json output "msg": { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": false,

[ansible-project] Re: How to fix warning message conditional statements should not include jinja2 templating delimiters

2020-02-11 Thread Jordan Borean
- debug: msg: Hi when: - entrycurrdb.stdout.find(hostvars['localhost']['BASEPATH_FINAL'] ~ '/' ~ vars[(item | splitext)[1].split('.')[1] | default('exe')] ~ '/' ~ item | basename) == -1 - actualfile.stat.exists | bool A few comments though - This is an extremely complex and weird

Re: [ansible-project] When var1 == "yes" and var2 == "no"

2020-02-11 Thread Jesse Lyon
Perfect! I didn't realize the indentation had to be outside the module parameter, the example I was using was poorly written it seems. I appreciate the help Stefan! -- Jess On Tuesday, February 11, 2020 at 12:51:14 PM UTC-5, Stefan Hornburg (Racke) wrote: > > On 2/11/20 6:44 PM, Jesse Lyon

Re: [ansible-project] When var1 == "yes" and var2 == "no"

2020-02-11 Thread Stefan Hornburg (Racke)
On 2/11/20 6:44 PM, Jesse Lyon wrote: > So, > > I'm having fits with when conditionals matching strings > No matter what I do, it applies each conditional, the combination of the > variables doesn't seem to count for ... anything. > > what the heck am I doing wrong? additionally, is there a

[ansible-project] Re: win_domain_group_membership

2020-02-11 Thread Jesse Lyon
I fixed it from the above error, PEBKAC. Updated the PR :) On Monday, February 10, 2020 at 4:28:05 PM UTC-5, Jesse Lyon wrote: > > The full traceback is: > Could not add member(s) to one or more ADGroup. > At line:82 char:9 > + Add-ADPrincipalGroupMembership -Identity $group_member -Membe

[ansible-project] When var1 == "yes" and var2 == "no"

2020-02-11 Thread Jesse Lyon
So, I'm having fits with when conditionals matching strings No matter what I do, it applies each conditional, the combination of the variables doesn't seem to count for ... anything. what the heck am I doing wrong? additionally, is there a better way to do this? - name: H - Set FIM Flag -

Re: [ansible-project] How to split a json key containing a colon into 2 keys

2020-02-11 Thread jean-christophe manciot
I'm impressed. It works perfectly. Only the first key is split as expected.. On Friday, February 7, 2020 at 7:12:40 PM UTC+1, Vladimir Botka wrote: > > On Fri, 7 Feb 2020 08:14:56 -0800 (PST) > jean-christophe manciot > wrote: > > > I receive some json data which *sometimes* start with the

[ansible-project] use binascii.unhexlify() in Jinja2 template

2020-02-11 Thread Michael Ströder
HI! I'm using stat task to let ansible calculate the SHA-512 checksum of a file on the managed node [1] which returns hex-encoded hash values. Now I have to convert the checksum to bytes prior to base64-encoding this byte string. In Python code I would use the function binascii.unhexlify(). But

[ansible-project] How to fix warning message conditional statements should not include jinja2 templating delimiters

2020-02-11 Thread Shifa Shaikh
How do I make changes to the below complex when condition without breaking the code in order to address the warning. - debug: msg: "Hi" when: entrycurrdb.stdout.find("{{ hostvars['localhost']['BASEPATH_FINAL'] }}/{{ vars[(item | splitext)[1].split('.')[1] | default('exe')] }}/{{

[ansible-project] How to fix warning message conditional statements should not include jinja2 templating delimiters

2020-02-11 Thread Shifa Shaikh
How do I make changes to the below complex when condition without breaking the code in order to address the warning. - debug: msg: "Hi" when: entrycurrdb.stdout.find("{{ hostvars['localhost']['BASEPATH_FINAL'] }}/{{ vars[(item | splitext)[1].split('.')[1] | default('exe')] }}/{{

[ansible-project] Re: simple problem has me stumped

2020-02-11 Thread misterT1958
Ah, now I see what you mean - got it working! Thanks so much for the hand! kind regards, T On Monday, February 10, 2020 at 4:33:14 PM UTC-5, misterT1958 wrote: > > I have a simple scenario that fails, but I can't figure out why. Here's > the command line invocation and the result: > >

Re: [ansible-project] Jinja2 template loop with JSON

2020-02-11 Thread Juergen Hofer
Am Dienstag, 11. Februar 2020 13:23:16 UTC+1 schrieb Stefan Hornburg (Racke): > > > Hello Juergen, > > this should do the trick: > > {% for item in host.INT_LIST %} > > I suggest to pick a different loop variable name as "item" is the standard > one > in Jinja. > > Regards >

Re: [ansible-project] parted - azure managed disks - unrecognized disk label

2020-02-11 Thread 'deewon' via Ansible Project
I got to the bottom of this eventually :) The task was running on the controller which didn't have a /dev/sdc device :) Simply delegating the task to the remote node fixed the problem Thanks! On Tuesday, February 11, 2020 at 10:41:44 AM UTC, deewon wrote: > > Thanks Hugo! > > I gave this a

Re: [ansible-project] Jinja2 template loop with JSON

2020-02-11 Thread Stefan Hornburg (Racke)
On 2/11/20 1:14 PM, Juergen Hofer wrote: > Hello all, > > I am a Network Engineer and Ansible is relative new for me. > > At the moment I am trying to build a template with "JSON" as source. See > below. > > The template should do the follwing (hopefully you get the idea). > I am struggling,

[ansible-project] Jinja2 template loop with JSON

2020-02-11 Thread Juergen Hofer
Hello all, I am a Network Engineer and Ansible is relative new for me. At the moment I am trying to build a template with "JSON" as source. See below. The template should do the follwing (hopefully you get the idea). I am struggling, how can i get the items in the list "INT_LIST" ? Can someone

Re: [ansible-project] How to ron SQL stored Procedures with Ansible

2020-02-11 Thread Kai Stian Olstad
On Wed, Feb 05, 2020 at 11:01:17AM -0600, Jeff Knights wrote: > How do I get ansible to run a folder full of SQL stored procedures on a > remote sql server? > > any help would be appreciated. You could use find module to find all the file and then run them with command/shell module if there is

Re: [ansible-project] Ansible expect module with Oracle SBC

2020-02-11 Thread Kai Stian Olstad
On Wed, Feb 05, 2020 at 01:05:57AM -0800, Gerhard Van Der Wath wrote: > Hi. Hi, if you had posted a plain text mail instead of HTML you would have gotten a replay a lot sooner. As you can see bellow you formatting is hard to read. > tasks: > > - name: Get CPU load > expect: > command: ssh

[ansible-project] Automating LDAP integration of artifactory using ansible

2020-02-11 Thread Vishal Bobade
Hi, could some one help me in understanding if the below yaml code can be used in ansible-playbook to achieve the automation of LDAP integration. security: #Security configuration (LDAP, SAML, Password Policy, ...) ldapSettings: #LDAP server(s) settings ldap1: #The unique ID of the

Re: [ansible-project] parted - azure managed disks - unrecognized disk label

2020-02-11 Thread 'deewon' via Ansible Project
Thanks Hugo! I gave this a go with the label explicitly specified and it returned the same error i.e. - name: Partition Disk parted: device: /dev/sdc number: 1 state: present label: msdos TASK [role_azure_disk : Partition Azure Disk]

Re: [ansible-project] aws ec2 attach snapshot ansible playbook error message

2020-02-11 Thread Stefan Hornburg (Racke)
On 2/11/20 7:52 AM, Sandy Hung wrote: > Dear all: > > I have some problem I don't know I attach ebs from snapshot but attach show > error message please help thanks. > > fatal: [localhost]: FAILED! => { >     "msg": "The task includes an option with an undefined variable. The error > was: list