Re: [ansible-project] change root password - ned help

2020-10-27 Thread Sebastian Meyer
results > debug: msg=" {{ result }}" > vars_files: > - answerfile.yml try something like: - hosts: esx tasks: - name: foo bar: baz: blah delegate_to: localhost Then the task should be run once for each host, but always on localhost. Se

Re: [ansible-project] shell

2019-09-09 Thread Sebastian Meyer
gt; > - name: Ansible fact - ansible_date_time > shell: date.sh > ^ here > -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: In

Re: [ansible-project] if win_chocolatey can install Visual studio community?

2019-08-14 Thread Sebastian Meyer
On 14.08.19 04:49, 舒何伟 wrote: > " See the log for details > (C:\ProgramData\chocolatey\logs\chocolatey.log).", What does the log say? -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg / http://

Re: [ansible-project] I have setup an ansible user that can login with a ssh-key and sudo su - with no password but this appears not to work.

2019-08-13 Thread Sebastian Meyer
Hi Steven, On 13.08.19 22:34, Steven Mething wrote: > How do I fault find such an issue? > Ansible doesn't do sudo su -. It does sudo python /ANSIBLETMP/CURRENTTASK.py or something like that. Can you show us your sudoers config? Sebastian -- Sebastian Meyer Linux Consultant & Tr

Re: [ansible-project] using variable from another file

2019-08-06 Thread Sebastian Meyer
w how to get my first line and make it a variable in my 1st file > See: https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#defining-variables-in-files Sebastian -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems GmbH Osterfeldst

Re: [ansible-project] Help for variable defination

2019-08-06 Thread Sebastian Meyer
rwise you might want to look at setting a different variable and merge them using set_fact and the combine jinja filter. Sebastian -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de GF: Ralph Dehn

Re: [ansible-project] Ansible any_errors_fatal does not work as expected. Need Fix

2019-08-06 Thread Sebastian Meyer
r loop to skip all remaining items on that task on that host once an error has occured you can use my second example. If you add any_errors_fatal all hosts won't execute any other tasks. Sebastian -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems GmbH Osterfe

Re: [ansible-project] import_tasks: vs include: when using when: conditional

2019-08-05 Thread Sebastian Meyer
TASK [foobar : include_tasks] skipping: [localhost] TASK [foobar : debug] ok: [localhost] => { "msg": "End" } PLAY RECAP [...] Sebastian -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 System

Re: [ansible-project] Ansible any_errors_fatal does not work as expected. Need Fix

2019-08-05 Thread Sebastian Meyer
s": ["mkdir: cannot create directory ‘/tmp/foo/baz/bar’: No such file or directory"], "stdout": "", "stdout_lines": []} skipping: [localhost] => (item=/tmp/foo/bar/baz) skipping: [localhost] => (item=/tmp/foo/abc) PLAY RECAP **

Re: [ansible-project] Ansible for openstack

2019-08-05 Thread Sebastian Meyer
> and it went successfully. Now i want to remove the resources what order i > should follow: > I tried 1 task and it is success > 1. delete SG rule > > after that i am getting stuck because anything i try to delete , it has > association with some other resource. > > Help me

Re: [ansible-project] Ansible For Openstack

2019-08-01 Thread Sebastian Meyer
t remove a network, if theres still an instance on it. -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537 -- Deutsche OpenStack T

Re: [ansible-project] Ansible For Openstack

2019-08-01 Thread Sebastian Meyer
iven by openstacksdk, which means that values can come from a yaml config file in /etc/ansible/openstack.yaml, /etc/openstack/clouds.yaml or ~/.config/openstack/clouds.yaml Sebastian -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 8

Re: [ansible-project] Best way to organize your playbooks

2019-07-31 Thread Sebastian Meyer
rectory structure like this: ansible/ common/roles/ app1/roles/ app2/roles/ and in the app folders each an ansible.cfg with: roles_path: ./roles:../common/roles [0] https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-roles-path -- Sebastian Meyer Linux Consu

Re: [ansible-project] The destination directory (/sys/module/nvme_core/parameters) is not writable by the current user

2019-07-29 Thread Sebastian Meyer
meout changed_when: false - name: Set nvme.io_timeout value shell: "echo {{ nvme_target_timeout }} > /sys/module/nvme_core/parameters/io_timeout" when: nvme_current_timeout.stdout|int != nvme_target_timeout|int Regards, Sebastian -- Sebastian Meyer Linux Consul

Re: [ansible-project] Variable registration is getting skipped in zypper module

2019-06-13 Thread Sebastian Meyer
SE Leap 42.3" 56 packages to upgrade, 6 new. Overall download size: 27.8 MiB. Already cached: 0 B. After the operation, additional 12.4 MiB will be used. Continue? [y/n/...? shows all options] (y): y Regards -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems G

Re: [ansible-project] Ansible iterate from file and populate template

2019-06-13 Thread Sebastian Meyer
e csvfile lookup. https://docs.ansible.com/ansible/latest/plugins/lookup/csvfile.html Regards Sebastian -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de GF: Ralph Dehner / Unternehmenssitz:

Re: [ansible-project] add list from host variables and group variables

2019-05-27 Thread Sebastian Meyer
) }}" tasks: - debug: var: city HTH, Sebastian -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537 -- You received

Re: [ansible-project] Default filter issue

2019-05-14 Thread Sebastian Meyer
simpler/better :) Sebastian > > But it return error: > > > FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'dict > object' has no attribute 'examples'"}. > > > I read something about default can use only 1 level deep, bu

Re: [ansible-project] ERROR! Syntax Error while loading YAML. mapping values are not allowed in this context

2019-05-03 Thread Sebastian Meyer
On 03.05.19 11:38, op...@netexpress.de wrote: > -name: postfix - set debconf defaults before postfix install You are missing a space here between the hyphen and name. Sebastian -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems GmbH Osterfeldstraße 7

Re: [ansible-project] i can't list hard disk info

2019-05-02 Thread Sebastian Meyer
ding on the exact syntax >> problem.\n\nThe offending line appears to be:\n\n\n    - debug:\n      >> ^ here\n"} >> >> What I do? > > > Hi, > > Try with disk_facts.guest_disk_facts[1]instead... disk_facts.guest_disk_facts.1 and disk_facts.guest_disk_facts[1] both

Re: [ansible-project] pip install docker-compose

2019-04-10 Thread Sebastian Meyer
8.5-36)] on linux2 >> Type "help", "copyright", "credits" or "license" for more information. >>>>> import compose >>>>> exit() >> [ameyer@awx01 ~]$ >> >> >> >> On Tuesday, April 9, 2019 at 4:09:

Re: [ansible-project] How to capture/filter stdout_lines

2019-04-09 Thread Sebastian Meyer
is and it didn't work. > > "{{ Regvar.stdout_lines | last }}" Try {{ regvar.stdout_lines[-1] }} > -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de GF: Ralph Dehner / Unterne

Re: [ansible-project] pip install docker-compose

2019-04-09 Thread Sebastian Meyer
t 12 2017, 15:50:02) [GCC] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import compose >>> I noticed you executed the installer playbook with root. Could you check pip and ansible_python_versi

Re: [ansible-project] pip install docker-compose

2019-04-09 Thread Sebastian Meyer
e maintained after > that date. A future version of pip will drop support for Python 2.7. > docker-compose==1.22.0 > docker-py==1.10.6 > docker-pycreds==0.4.0 > dockerpty==0.4.1 > > > I'm not sure why this is not working. I am running this against the > localhost. &g

Re: [ansible-project] Execut playbook host after host

2019-04-08 Thread Sebastian Meyer
ansible/latest/user_guide/playbooks_delegation.html#rolling-update-batch-size Use `serial: 1` HTH, Sebastian -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de GF: Ralph Dehner / Unternehmenssitz:

Re: [ansible-project] open(module, 'wb') SyntaxError for raw module in ansible-playbook

2019-04-04 Thread Sebastian Meyer
work around this issue ? You need to set gather_facts to no. gather_facts uses the setup module, which is Python. - hosts: servers gather_facts: no tasks: [...] Sebastian > > -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems GmbH Osterfeld

Re: [ansible-project] how to access debug stdout variable

2019-04-03 Thread Sebastian Meyer
y afterwards the results are merged. Sebastian > > > On Wednesday, April 3, 2019 at 8:01:59 PM UTC+5:30, Sebastian Meyer wrote: >> >> On 03.04.19 16:22, Kunalsing Thakur wrote: >>> --- >>> - name: Logging into pulp >>> shell: pulp-admin logi

Re: [ansible-project] how to access debug stdout variable

2019-04-03 Thread Sebastian Meyer
th_items: "{{ rpmname | default([]) }}" > register: pulp > when: rpmsearch is defined You are using register with a loop. That means pulp.results is a list and there's an element for each item in that list. You can access the stdout for the first item with pulp.results.0.stdout

Re: [ansible-project] Check Number Of Wheel Group Members

2019-04-02 Thread Sebastian Meyer
On 02.04.19 19:50, Jon Adcock wrote: >that: getent_group.wheel|default(["", "", ""])[2] == "" You'll need () around the getent and default: that: (getent_group.wheel|default(["", "", ""]))[2] == "" The ab

Re: [ansible-project] Edit playbook to work with Packer Ansible Provisioner

2019-04-02 Thread Sebastian Meyer
user > > become: yes > > become_user: root > > tasks: > > - name: run yum update -y using yum module > > yum: > > name: "*" > > state: latest > > Thank You much for any help > -- Sebastian Meyer Linux C

Re: [ansible-project] Memory error when downloading 3.4GB file

2019-03-28 Thread Sebastian Meyer
ngle python process goes up to 12.5GB before settling at 9.7GB. So you might not have enough RAM on the system you're slurping the file from. Sebastian -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg / http://www.b

Re: [ansible-project] Run script that requires 'sudo' on remote hosts.

2019-03-28 Thread Sebastian Meyer
allowed to execute this script with sudo and not use sudo for ALL, then you are right to use command: sudo /usr/local/bin/application_stop_start.sh stop You may want to add warn: no See: https://docs.ansible.com/ansible/latest/modules/command_module.html?highlight=warn Sebastian -- Sebastian Mey

Re: [ansible-project] Re: Nmcli module static routes

2019-03-28 Thread Sebastian Meyer
;> Hi, >> >> Dont see any documentation regarding adding static routes using nmcli >> modules. Is it feasible to add static routes, if yes please let me know and >> sample example would help. >> > -- Sebastian Meyer Linux Consultant & Trainer Mail: me..

Re: [ansible-project] Run script that requires 'sudo' on remote hosts.

2019-03-27 Thread Sebastian Meyer
suggestions? > Thanks. You still need `become: true`, since you want to _become_ root executing this script. Just setting the become_method to sudo won't do anything. Sebastian > -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems GmbH Osterfeldstraße 7

Re: [ansible-project] yum module gives "AttributeError: 'list' object has no attribute 'strip'" on list of items

2019-03-27 Thread Sebastian Meyer
{ base_pkgs + additional_pkgs | default([]) }}" Ansible wants a flat list here. The suggestion in the deprecation warning thinks both are just normal values and wants you to put them into a list. But if you already have lists, merge them with + as in the above code. HTH, Sebastian -- Sebast

Re: [ansible-project] Ansible modules copy/template errors for Linux 5 hosts using python26 ,python binding libselinux-python needed

2019-03-27 Thread Sebastian Meyer
ing the system libselinux-python. Sebastian -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537 -- You received this message beca

Re: [ansible-project] debug statement not working

2019-03-26 Thread Sebastian Meyer
"TaniumClient-6.0.314.1442-1.rhe7.x86_64" > ] > }, > > > but > > - debug: > msg: "{{ pkg.results.stdout }}" > > fails. Seems like I should be able to print that. You could print {{ pkg.results.0.std

Re: [ansible-project] Re: Limiting hosts when including playbooks

2019-03-26 Thread Sebastian Meyer
orin >>>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups >>>>> "Ansible Project" group. >>>>> To unsubscribe from this group and stop receiving emai

Re: [ansible-project] command scp in ansible

2019-03-22 Thread Sebastian Meyer
- Sebastian -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537 -- You received this message because you are subscribed to t

Re: [ansible-project] command scp in ansible

2019-03-22 Thread Sebastian Meyer
as the command linux > scp -rp Not via a module. You'll need to use command for that. - Sebastian > > Thanks community ansible !! ;) > > Regards, > -- Sebastian Meyer Linux Consultant & Trainer Tel.: +49-172-2057471 Mail: me...@b1-systems.de B1 Systems GmbH Osterf

Re: [ansible-project] Re: Using defaults for Ansible user module for for "home", "group" and "groups"

2019-03-22 Thread Sebastian Meyer
error that "Group "" does not exist". > > If I try > > group: "{{item.group if item.group is defined else item.username }}" > > then Ansible fails with the group does not exist. > > Whereas the default without specifying is that it creates it

Re: [ansible-project] Re: Need help with how to grab public ip and use it for later part in playbook

2019-03-22 Thread Sebastian Meyer
;, >> "subnet_id": "subnet-", >> "vpc_id": "vpc-x" >> } >> ], >> "placement": { >> &qu

Re: [ansible-project] user_module and ssh key

2019-03-22 Thread Sebastian Meyer
g in the docs, it's fixed in the devel docs: https://docs.ansible.com/ansible/devel/modules/user_module.html - Sebastian > -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de GF: Ralph Dehner / Unternehmen

Re: [ansible-project] Need help with how to grab public ip and use it for later part in playbook

2019-03-21 Thread Sebastian Meyer
t;: "xx.xxx.44.51", > "root_device_name": "/dev/xvda", [...] > } > ] > } > } > > > i want to use debug option in playbook to print only the public ip > > ec2.instances.public_ip is not working instanc

Re: [ansible-project] ansible fail to work with ssh

2019-03-19 Thread Sebastian Meyer
did not specify a user there). If that user is different from the one you use for ansible, then the key can't be used. - Sebastian -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de GF: Ralph

Re: [ansible-project] convert yaml file into jinja

2019-03-19 Thread Sebastian Meyer
n a playbook: {{ ansible_facts['disks'][0]['size'] }} - Sebastian -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537 -- You recei

Re: [ansible-project] SSH Access to the Remote servers

2019-03-17 Thread Sebastian Meyer
is, if normal ssh works as expected. > - ansible.cfg You should not need to specify anything here. If you need to keep your ssh_config in a location the systems SSH client wouldn't look for it, you probably could add a -F /path/to/your/ssh/config to the ssh_args parameter. HTH Sebastian -- Sebas

Re: [ansible-project] unable to delete line file

2019-03-12 Thread Sebastian Meyer
the node currently running the task. If you want to delete a line starting with the name of the node you'll need '^{{ ansible_hostname }}', without the $ which means line end. If you are getting an error, providing the error message would help ... Regards -- Sebastian Meyer Linux Consultant &

Re: [ansible-project] conditionals

2019-03-11 Thread Sebastian Meyer
2 : ok=1changed=0 unreachable=0failed=0 Hope that helps, Sebastian -- Sebastian Meyer Linux Consultant & Trainer Mail: me...@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,