[ansible-project] Ansible Inventory file

2019-02-01 Thread Deepak Sharma
Hi Everyone, I am new to Ansible , I have created new inventory yml file with below details . KafkaNonprodservers: hosts: abc.abc.com:2022 abd.abd.com:2022 ansible_user : abc but I am getting below error + ansible-inventory -i ./ansible/Hosts.yml --list [WARNING]: Skipping

[ansible-project] Ansible but with Python instead of YAML

2019-02-01 Thread Thomas Güttler
I am using a different config management tool up to now (not ansible). I think about switching to ansible. But I don't like YAML. I like Python. Is it doable to use Python syntax instead of YAML? Is it feasible to do this? -- You received this message because you are subscribed to the

Re: [ansible-project] Ansible but with Python instead of YAML

2019-02-01 Thread Sudheer S
On 01/02/19 4:12 PM, Thomas Güttler wrote: I am using a different config management tool up to now (not ansible). I think about switching to ansible. But I don't like YAML. Ansible embraces YAML. I like Python. Is it doable to use Python syntax instead of YAML? Technically, yes. But

Re: [ansible-project] Ansible but with Python instead of YAML

2019-02-01 Thread Thomas Güttler
Am Freitag, 1. Februar 2019 12:33:48 UTC+1 schrieb Sudheer S: > > > On 01/02/19 4:12 PM, Thomas Güttler wrote: > > I am using a different config management tool up to now (not ansible). > > I think about switching to ansible. > > But I don't like YAML. > > Ansible embraces YAML. > > I like

Re: [ansible-project] Ansible but with Python instead of YAML

2019-02-01 Thread Josh Smift
YAML is great; I was confused at first because I thought it was a "markup language" like HTML, but it's just a way to represent data structures. It's not a programming language, though. If you want to write your system configuration in a programming language (Python, in this case :^), you

Re: [ansible-project] removing a domain form sssd.conf

2019-02-01 Thread Kai Stian Olstad
On 01.02.2019 14:22, Lewis Carroll wrote: I am trying to figure out how to use replace or lineinfile to remove a domain entry in sssd.conf. Here is example: [domain/example] cache_credentials = false enumerate = true ldap_schema = rfc2307 ldap_rfc2307_fallback_to_local_users = true

Re: [ansible-project] Ansible but with Python instead of YAML

2019-02-01 Thread Thomas Güttler
Am Freitag, 1. Februar 2019 15:20:14 UTC+1 schrieb Josh Smift: > > YAML is great; I was confused at first because I thought it was a "markup > language" like HTML, but it's just a way to represent data structures. > > It's not a programming language, though. If you want to write your system >

[ansible-project] removing a domain form sssd.conf

2019-02-01 Thread Lewis Carroll
I am trying to figure out how to use replace or lineinfile to remove a domain entry in sssd.conf. Here is example: [domain/example] > cache_credentials = false > enumerate = true > ldap_schema = rfc2307 > ldap_rfc2307_fallback_to_local_users = true > ldap_search_base = dc=example,dc=com >

Re: [ansible-project] Ansible but with Python instead of YAML

2019-02-01 Thread Jonathan Lozada De La Matta
if you know that then its pretty easy to leanr YML. Specially when the ansible documents have a lot of examples. On Fri, Feb 1, 2019 at 8:07 AM Thomas Güttler wrote: > > > Am Freitag, 1. Februar 2019 12:33:48 UTC+1 schrieb Sudheer S: >> >> >> On 01/02/19 4:12 PM, Thomas Güttler wrote: >> >> I

Re: [ansible-project] become_flags for specific inventory host

2019-02-01 Thread Bruno Cochofel
Thanks Matt, that worked. On Thursday, January 31, 2019 at 6:13:46 PM UTC, Matt Martz wrote: > > To place it in hostvars you need to name it `ansible_become_flags`: > > > https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#list-of-behavioral-inventory-parameters > > On Thu,

Re: [ansible-project] Ansible Inventory file

2019-02-01 Thread Keif Gwinn
Hi Deepak, ansible_user is a special variable used by ansible for ssh, part of the main config. If you use a different variable name in your config file you should be fine. https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#list-of-behavioral-inventory-parameters On Fri, 1

[ansible-project] Re: Ansible but with Python instead of YAML

2019-02-01 Thread Joe Langdon
I would take a look at Troposphere. It is a Python project that creates JSON / YAML for Cloudformation scripts. Very similar to what you want to do. I have not heard of the same project for Ansible https://github.com/cloudtools/troposphere On Friday, February 1, 2019 at 5:42:53 AM UTC-5,

[ansible-project] Re: Ansible but with Python instead of YAML

2019-02-01 Thread Thomas Güttler
Am Freitag, 1. Februar 2019 15:26:21 UTC+1 schrieb Joe Langdon: > > I would take a look at Troposphere. It is a Python project that creates > JSON / YAML for Cloudformation scripts. Very similar to what you want to > do. I have not heard of the same project for Ansible > >

Re: [ansible-project] removing a domain form sssd.conf

2019-02-01 Thread Lewis Carroll
Nice. I new I was missing something. I went with the second option. It replaced all the text with a blank line. The former left a blank line for each match. On Friday, February 1, 2019 at 9:11:59 AM UTC-6, Kai Stian Olstad wrote: > > On 01.02.2019 14:22, Lewis Carroll wrote: > > I am trying to

Re: [ansible-project] Ansible Inventory file

2019-02-01 Thread Keif Gwinn
KafkaNonprodservers: hosts: abc.abc.com:2022 abd.abd.com:2022 vars: ansible_user: abc On Fri, 1 Feb 2019 at 16:12, Keif Gwinn wrote: > sorry got the wrong idea, I'm also new to ansible. > > The variables you're adding need to go under a vars section > > KafkaNonprodservers: > hosts: > -

Re: [ansible-project] Ansible Inventory file

2019-02-01 Thread Keif Gwinn
sorry got the wrong idea, I'm also new to ansible. The variables you're adding need to go under a vars section KafkaNonprodservers: hosts: - abc.abc.com:2022 - abd.abd.com:2022 vars: ansible_user: abc [keif@ansible-lab ansible]$ ansible-inventory -i keif/test.yml --list {

Re: [ansible-project] --skip-tags equivalent inside playbooks

2019-02-01 Thread Brian Coca
No, it is not possible -- 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 ansible-project+unsubscr...@googlegroups.com. To post to this

Re: [ansible-project] Is there a way to get current task name?

2019-02-01 Thread Brian Coca
no, there is very little 'introspection' to the task itself. -- -- 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

[ansible-project] win_task_scheduler - setting memory and io priority

2019-02-01 Thread Subhi Andrews
Is there a way to do this via win_task_scheduler or otherwise? Priority setting in win_task_scheduler only affects process priority and not IO/mem priorities. Anyone has any suggestions? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To

Re: [ansible-project] Updating Ansible hosts inventory dynamically

2019-02-01 Thread Kai Stian Olstad
On 01.02.2019 21:13, Subhi Andrews wrote: Thank you, Kai. Will check it out. So if we can write a script that generates inventory in json format, we can directly pass the script to the ansible-playbook command? Did I understand that correctly? That is correct, if a inventory file doesn't

[ansible-project] Updating Ansible hosts inventory dynamically

2019-02-01 Thread Subhi Andrews
We have our hosts inventory organized by environments. We tend to have alpha versions of software deployed in our test environment. Are there any thoughts on keeping the inventory dynamically updated if we decide to move a host between environment - say from test to dev or from dev to

Re: [ansible-project] Ansible Inventory file

2019-02-01 Thread Hugo Gonzalez
Hello Deepak, You're not following the right syntax for a YML inventory. Check the following link: https://docs.ansible.com/ansible/latest/plugins/inventory/yaml.html I don't know what you're trying to do with the " 2022" string there. It's not valid yaml. According to the docs in the

Re: [ansible-project] Updating Ansible hosts inventory dynamically

2019-02-01 Thread Kai Stian Olstad
On 01.02.2019 20:09, Subhi Andrews wrote: We have our hosts inventory organized by environments. We tend to have alpha versions of software deployed in our test environment. Are there any thoughts on keeping the inventory dynamically updated if we decide to move a host between environment -

[ansible-project] Defined variable when value different

2019-02-01 Thread Rafael Tomelin
Hi, How defined variable value when other variable for different the 1. Exemplo vars: networkinterface_number: 1 - name: Create network interface azure_rm_networkinterface: name: "interface{{networkinterface_number}}" resource_group: my_resource virtual_network_name:

Re: [ansible-project] Ansible Inventory file

2019-02-01 Thread Deepak Sharma
Thanks Keif, I have added vars as port and users, after that it is working fine. Regards, Deepak On Fri, Feb 1, 2019 at 5:12 PM Keif Gwinn wrote: > sorry got the wrong idea, I'm also new to ansible. > > The variables you're adding need to go under a vars section > > KafkaNonprodservers: >

Re: [ansible-project] Updating Ansible hosts inventory dynamically

2019-02-01 Thread Subhi Andrews
Thank you, Kai. Will check it out. So if we can write a script that generates inventory in json format, we can directly pass the script to the ansible-playbook command? Did I understand that correctly? Regards, On Fri, Feb 1, 2019 at 11:26 AM Kai Stian Olstad < ansible-project+l...@olstad.com>

[ansible-project] Re: Cisco Show Power Inline command with Ansible

2019-02-01 Thread Spiro Mitsialis
Hi, I wrote a parser that will take the output and add it to a dictionary. I've tested it on a C3850 but you can try it and see if it works on your device. You may need to modify it to work with your switch (Nexus?). If your interested I'll put it up on GitHub and provide the link. Spiro

Re: [ansible-project] Ansible Inventory file

2019-02-01 Thread Deepak Sharma
Hi Hugo, Thanks a lot , now it is working fine. Regards, Deepak On Fri, Feb 1, 2019 at 8:20 PM Hugo Gonzalez wrote: > Hello Deepak, > > You're not following the right syntax for a YML inventory. Check the > following link: > >

Re: [ansible-project] How to import/load env/ini file that is located in file on the Remote/Target server?

2019-02-01 Thread Chaz_E
Hi Hugo, I like your suggestion -- is so close -- and pretty elegant. However - */etc/ansible/facts.d *is owned by root. Even though the INI/Property file you loaded was not owned by root, Only root could have added */etc/ansible/facts.d/**factfile.fact* Thanks for trying! Let me know if you

Re: [ansible-project] --skip-tags equivalent inside playbooks

2019-02-01 Thread Igor Cicimov
Brian, I find the current usage of "tags" when calling a role via "roles:" or "include_role/import_role" is counter intuitive. The reason we tag tasks in our playbooks is for the purpose of filtering which we would expect to be the case in the above mentioned scenarios as well. But it is not,

Re: [ansible-project] removing a domain form sssd.conf

2019-02-01 Thread S C Rigler
Or you could use the ini_file module to remove the section. On Fri, Feb 1, 2019, 7:23 AM Lewis Carroll I am trying to figure out how to use replace or lineinfile to remove a > domain entry in sssd.conf. Here is example: > > [domain/example] >> cache_credentials = false >> enumerate = true >>

[ansible-project] Ansible Playbook ssh connectivity fails only on a particular server

2019-02-01 Thread Easy King
Below ansible-playbook connectivity works fine for all my servers except server2. Below command fails. ansible-playbook - /opt/test/scripts/Auto/site.yml -i /opt/test/scripts /Auto/hosts.txt -e "source_host=server2 execmd=echo source_user=user2" Output: (0, '', 'OpenSSH_7.7p1