Re: [ansible-project] How to handle multi-line prompts with expect module?

2018-05-14 Thread ZillaYT
"Enter key password" : "{{ keystore_pw }}" Interestingly enough, the following gives a syntax error "\[no\]" but corrected with this \[no\] On Monday, May 14, 2018 at 2:31:45 PM UTC-4, ZillaYT wrote: > > This helped some, but brought up the next issue.

Re: [ansible-project] How to handle multi-line prompts with expect module?

2018-05-14 Thread ZillaYT
key (\[Unknown\]). Using last defined value only. I need to somehow include part of each prompt in the regex? On Monday, May 14, 2018 at 1:45:43 PM UTC-4, Kai Stian Olstad wrote: > > On 14.05.2018 19:02, ZillaYT wrote: > > Per https://groups.google.com/forum/#!topic/ansible-project/AXEPsAq

[ansible-project] How to handle multi-line prompts with expect module?

2018-05-14 Thread ZillaYT
Per https://groups.google.com/forum/#!topic/ansible-project/AXEPsAqxmNE I'm using the expect module, and have it working when the prompt is single line. How do I make it work when the prompt is multi-line? I'm not talking about multi-prompts. Let me explain. ansible v2.4.0.0 I'm trying to

[ansible-project] Re: Ansible not recognizing correct pexpect module?

2018-05-14 Thread ZillaYT
I meant to say "I'm trying to use the "expect" module in ansible..." On Monday, May 14, 2018 at 11:35:43 AM UTC-4, ZillaYT wrote: > > $ ansible --version > ansible 2.4.0.0 > config file = /etc/ansible/ansible.cfg > configured module search path = > [

[ansible-project] Ansible not recognizing correct pexpect module?

2018-05-14 Thread ZillaYT
$ ansible --version ansible 2.4.0.0 config file = /etc/ansible/ansible.cfg configured module search path = [u'/home/scscm_builder/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location =

[ansible-project] Re: How to orchestrate master/slave configuration with Ansible group_by, if that's the proper approach?

2018-04-19 Thread ZillaYT
IOW, I want to create a host group from the master and slaves vars of the passed-in limit, github1 in this case. On Wednesday, April 18, 2018 at 11:39:02 AM UTC-4, ZillaYT wrote: > > I'm setting up a Github master/slave configuration via Ansible role.I set > up my github inventory f

[ansible-project] How to orchestrate master/slave configuration with Ansible group_by, if that's the proper approach?

2018-04-18 Thread ZillaYT
I'm setting up a Github master/slave configuration via Ansible role.I set up my github inventory file looks like this [github1] github1.domain.com [github2] github2.domain.com [github3] github3.domain.com (more node host groups) [*github1*:vars] master=github1 slaves=['github2', 'github3']

Re: [ansible-project] Re: Ansible role with a reboot fails

2018-04-18 Thread ZillaYT
ed. > > Regards, K. > > > On Wed, Apr 18, 2018 at 6:28 AM, John Harmon <jharmon...@gmail.com > > wrote: > >> Sorry, ignore my last post. I can see that is exactly what you did >> >> On Tuesday, April 17, 2018 at 12:47:13 PM UTC-6, ZillaYT wrote: >&

[ansible-project] Ansible role with a reboot fails

2018-04-17 Thread ZillaYT
I've trying to write an Ansible role that upgrades Github. The command to upgrade the server "ghe-upgrade github-2.13.1.pkg" for example, reboots the server, and when that happens, I get, the following connection because my ssh connection drops of course. TASK [github : Upgrade

Re: [ansible-project] Recursive copy without copying top dir?

2018-02-27 Thread ZillaYT
Thank you. Sad thing is I've done this before and (now) remember reading that part of the docs. On Tuesday, February 27, 2018 at 12:36:49 PM UTC-5, Kai Stian Olstad wrote: > > On Tuesday, 27 February 2018 18.30.09 CET ZillaYT wrote: > > Ansible v2.4.0.0 > > > > I w

[ansible-project] Recursive copy without copying top dir?

2018-02-27 Thread ZillaYT
Ansible v2.4.0.0 I want to copy the contents of a local directory to my target host, but the recursive option copies the directory itself. That is - name: Copy local files target copy: src: /tmp/local_dir dest: /some_path/remote_dir recurse: yes /tmp/local_dir has -

[ansible-project] Roles are download to a different directory when running ansible-galaxy install?

2018-02-14 Thread ZillaYT
Ansible v2.4.0.0 I have a requirements file that specifies the Git repo for each role that I want to use in my playbook, and I do the following to install the roles from our internal galaxy cd /path_to_playbook ansible-galaxy install -r requirements/requirements1.yml -p ./roles and I expect

Re: [ansible-project] How to log what a perl script does,called from an Ansible shell module?

2018-02-08 Thread ZillaYT
> I'd expect `install_rc` to show something though, likely indicating what > the problem is. > > Also, instead of using `cd`, look at using `chdir` instead: > > shell: /usr/local/perl ./install.pl --no-prompt > args: > chdir: /tmp/git-sync > > > > On Thu, Fe

Re: [ansible-project] How to log what a perl script does,called from an Ansible shell module?

2018-02-08 Thread ZillaYT
rompt > args: > chdir: /tmp/git-sync > > > > On Thu, Feb 8, 2018 at 11:02 AM, ZillaYT <zil...@gmail.com > > wrote: > >> I'm trying to automate installation of gitsyncd and gitmirrord >> applications via download of the git-syncing.git repository, w

[ansible-project] Re: Ansible on CENTOS VM SSH failing

2018-02-08 Thread ZillaYT
Have you set up your ssh keys between the two hosts, i.e., the user running Ansible and the target host? What happens if you just try to ssh to the target host? On Wednesday, February 7, 2018 at 6:27:39 AM UTC-5, Alfredo Bosca Bataller wrote: > > Hi gents, > > After installing ansible and

[ansible-project] How to log what a perl script does,called from an Ansible shell module?

2018-02-08 Thread ZillaYT
I'm trying to automate installation of gitsyncd and gitmirrord applications via download of the git-syncing.git repository, which installs a /tmp/git-sync/install.pl PERL script. I then run the following: - name: Install git-sync services shell: | cd /tmp/git-sync /usr/local/perl

[ansible-project] Re: Stuck on with_items and trying to pass specific value from 1 task to the next

2018-02-05 Thread ZillaYT
The answer in Ansible lookup values from complex structure? may give you and idea. On Friday, February 2, 2018 at 11:43:51 AM UTC-5, davros1984 wrote: > > Hi, > > I've spent the past few days trying to

[ansible-project] Re: The loop variable 'item' is already in use. You should set the `loop_var` value in the `loop_control` option for the task to something else to avoid variable collisions and unexp

2018-02-05 Thread ZillaYT
Regarding your second question about HAproxy and Ansible, well Ansible is NOT magic. Ansible does NOT do anything you wouldn't/couldn't manually, or in any other scripting language, do otherwise. For example, if I want to install services via package manger I may do this Shell script

[ansible-project] Re: The loop variable 'item' is already in use. You should set the `loop_var` value in the `loop_control` option for the task to something else to avoid variable collisions and unexp

2018-02-05 Thread ZillaYT
Where's your code? On Monday, February 5, 2018 at 9:58:42 AM UTC-5, Moncy Varghese wrote: > > Dear All, > > > I am having issues running the final step for ansible , > openstack-ansible setup-openstack.yml .It reports the below error > /opt/openstack-ansible/playbooks# screen > Monday 05

[ansible-project] Help printing out key/value pair from a register?

2018-02-05 Thread ZillaYT
I have a register with the following output of a query from the acl module. ok: [server.domain.com] => { "acl_query.results": [ { "_ansible_item_result": true, "_ansible_no_log": false, "changed": false, "item": [ {

[ansible-project] Re: Item name in task name.

2018-01-31 Thread ZillaYT
Try enclosing the name in double-quotes, e.g., tasks: - name: "Installing {{ item }}" yum: name: "{{ item }}" state: latest with_items: - httpd - firewalld On Monday, January 29, 2018 at 11:02:58 AM UTC-5, Varun Chopra wrote: > > Hi, > > I'm

[ansible-project] Re: Need help about Ansible block syntax

2018-01-31 Thread ZillaYT
block does not support ALL the features of a simple task so this may be your issue. For example, it may not support notify, but you'll need to look at this. On Wednesday, January 31, 2018 at 10:29:00 AM UTC-5, JiElPe-Fr38 wrote: > > Dear all, > > I am quite new to Ansible and try to "make a

[ansible-project] Re: Loops in Ansible

2018-01-30 Thread ZillaYT
I'm trying to do the same thing. What version of Ansible are you using? I use v2.4.2.0 and the acl module does NOT have a recursive parameter, but I see you use it? On Wednesday, March 15, 2017 at 9:50:31 AM UTC-4, Андрей Климентьев wrote: > > Hi, everyone. > > Would it be possible to somehow

Re: [ansible-project] Question on hosts and group_vars setup, and error when running playbook

2018-01-30 Thread ZillaYT
I have read, your inventory is currently > at: /path_to_playbooks/inventories/production/host_vars/git > It instead needs to be located > at: /path_to_playbooks/inventories/production/git > > Leaving your host_vars and group_vars where they are > > On Tue, Jan 30, 2018 at 9

[ansible-project] Question on hosts and group_vars setup, and error when running playbook

2018-01-30 Thread ZillaYT
I'm following the guidelines discussed in Laying out roles, inventories and playbooks , and I have segregated my development vs. productions files this way /path_to_playbooks/inventories/development/host_vars/git

Re: [ansible-project] How to make Ansible use certain Python libs?

2018-01-29 Thread ZillaYT
/bin/pip2.7 install ansible` > > That is just an assumption, you'll need to fill in the blanks. > > On Mon, Jan 29, 2018 at 2:41 PM, ZillaYT <zil...@gmail.com > > wrote: > >> I have >> >> $ which ansible >> /usr/bin/ansible >> user@hostname$ /usr/bin

Re: [ansible-project] How to make ansible read a json file on remote host?

2018-01-22 Thread ZillaYT
nts of the file. > > - slurp: > path: /opt/gitlab/version-manifest.json > register: version_file > > - set_fact: > installed_version: "{{ > (version_file.content|b64decode|from_json).build_version }}" > > On Mon, Jan 22, 2018 at 1:32 PM, ZillaYT <z

[ansible-project] How to make ansible read a json file on remote host?

2018-01-22 Thread ZillaYT
I following the technique suggested in how to read json file using ansible suggestion in Stackoverflow, and I do this - set_fact: version_file: "{{ lookup('file','/opt/gitlab/version-manifest.json') |

Re: [ansible-project] How to do math in Ansible?

2018-01-22 Thread ZillaYT
Thanks, I'l try this On Monday, January 22, 2018 at 12:31:12 PM UTC-5, Matt Martz wrote: > > Probably something like: > > - name: Ensure M_upgrade - M_installed = 1 > assert: > that: > - M_upgrade|int - M_installed|int == 1 > > On Mon, Jan 22, 201

Re: [ansible-project] How to do math in Ansible?

2018-01-22 Thread ZillaYT
I'm using yum (RHEL). However with this approach, don't you have to update the file when the major version changes? On Monday, January 22, 2018 at 12:33:07 PM UTC-5, Kai Stian Olstad wrote: > > On Monday, 22 January 2018 18.18.34 CET ZillaYT wrote: > > I have an Ansible ta

[ansible-project] How to do math in Ansible?

2018-01-22 Thread ZillaYT
I have an Ansible task that aims to upgrade our Gitlab application. I want the user to ONLY be able to upgrade 1 major release. For example, I want to enable a 8.x to 9.x upgrade, but not an 8.x to 10.x upgrade. I'm aware of the version_compare module, which I use, but need more than what it

[ansible-project] How to make Ansible use ALL inventory files in a directory?

2018-01-10 Thread ZillaYT
I'm segregating my development from my production inventories, and somewhat following the advice given in Laying out roles, inventories and playbooks . I therefore have the following directory structure. /path_to_playbook/inventories

Re: [ansible-project] In an Ansible task, what is the proper way to run a script in the background?

2018-01-05 Thread ZillaYT
Sorry, I meant supervisord as another means to start a deamon. On Friday, January 5, 2018 at 10:55:49 AM UTC-5, ZillaYT wrote: > > Thanks. I'll also look at synchronized application. > > On Friday, January 5, 2018 at 5:39:31 AM UTC-5, Kai Stian Olstad wrote: >> >> On 0

Re: [ansible-project] In an Ansible task, what is the proper way to run a script in the background?

2018-01-05 Thread ZillaYT
Thanks. I'll also look at synchronized application. On Friday, January 5, 2018 at 5:39:31 AM UTC-5, Kai Stian Olstad wrote: > > On 03.01.2018 20:55, ZillaYT wrote: > > Say I want to run a script in the background after my Ansible run > > finishes. > > Which of these tw

Re: [ansible-project] In an Ansible task, what is the proper way to run a script in the background?

2018-01-03 Thread ZillaYT
io > > On Jan 3, 2018 11:56 AM, "ZillaYT" <zil...@gmail.com > wrote: > >> Say I want to run a script in the background after my Ansible run >> finishes. Which of these two options is the correct way? >> >> *Option 1: Run a nohup on the Ansible task itself

[ansible-project] In an Ansible task, what is the proper way to run a script in the background?

2018-01-03 Thread ZillaYT
Say I want to run a script in the background after my Ansible run finishes. Which of these two options is the correct way? *Option 1: Run a nohup on the Ansible task itself* - name:Run a script in the background command: nohup myscript.sh 2>&1 & where myscript.sh does something (anything)

[ansible-project] Re: In v2.4.x.x how can I include host groups in one inventory file to another? If so how?

2017-12-06 Thread ZillaYT
owever, I would be interested in hearing your use case. > Always interesting to hear others perspective on how to use inventory, > group vars, and host vars. > > On Wednesday, December 6, 2017 at 4:16:07 AM UTC-5, ZillaYT wrote: >> >> Definitely a single inventory file is NO

[ansible-project] Re: In v2.4.x.x how can I include host groups in one inventory file to another? If so how?

2017-12-06 Thread ZillaYT
Definitely a single inventory file is NOT what I want/need, but thanks. -- 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] In v2.4.x.x how can I include host groups in one inventory file to another? If so how?

2017-12-05 Thread ZillaYT
Say I have inventory files that look like this host_vars/bitbucket_servers - [bb-cluster1] www.bb-loc1.domain.com www.bb-loc2.domain.com host_vars/gerritt_servers - [gerritt-cluster1] www.gerritt-loc1.domain.com

[ansible-project] Re: anskbile-galaxy install -r requirements/my-play-reqs.yml -p roles/ installs roles in /etc/ansible/roles instead of /path_to_playbooks/roles?

2017-11-29 Thread ZillaYT
The Ansible Galaxy page <http://docs.ansible.com/ansible/latest/galaxy.html#id2> at least say the "-r" or "--roles-path" option should override the roles_path setting in ansible.cfg On Wednesday, November 29, 2017 at 9:55:20 AM UTC-5, ZillaYT wrote: > > I have t

[ansible-project] anskbile-galaxy install -r requirements/my-play-reqs.yml -p roles/ installs roles in /etc/ansible/roles instead of /path_to_playbooks/roles?

2017-11-29 Thread ZillaYT
I have the following directory structure. The my-play-reqs.yml file contains the roles that I need for the my-play.yml playbook. /path_to_playbooks/my-play.yml /path_to_playbooks/requirements/my-play-reqs.yml ...and I run the following command to install my roles $ cd/path_to_playbooks $

Re: [ansible-project] Is it possible to do a yum update via yum module?

2017-11-28 Thread ZillaYT
Gitlab is just an example, it can be any package. On Tuesday, November 28, 2017 at 12:11:19 PM UTC-5, Kai Stian Olstad wrote: > > On Tuesday, 28 November 2017 18.02.25 CET ZillaYT wrote: > > Yeah I understand that, and maybe my question was flawed. In my case I > > wanted to

Re: [ansible-project] Is it possible to do a yum update via yum module?

2017-11-28 Thread ZillaYT
2 AM UTC-5, Kai Stian Olstad wrote: > > On Tuesday, 28 November 2017 17.20.31 CET ZillaYT wrote: > > I believe the answer to my question is "No" since I don't see it > documented > > in yum - Manages packages with the yum package manager > > <http

[ansible-project] Is it possible to do a yum update via yum module?

2017-11-28 Thread ZillaYT
I believe the answer to my question is "No" since I don't see it documented in yum - Manages packages with the yum package manager but thought I would ask. For example if I have gitlab-ce-8.14.3 and want to update to gitlab-ce-10.2.1

[ansible-project] Re: Unarchive nested zip file from local to remote directory

2017-11-15 Thread ZillaYT
You can't. Ansible just calls the appropriate uncompress application, in this case, unzip. You can't do what you want in unzip, so Ansible can't do it. On Wednesday, November 15, 2017 at 4:38:48 AM UTC-5, Dev wrote: > > Hello everyone, > > How in easiest way can I unarchive .zip file, with

[ansible-project] How to add become password in a task?

2017-11-15 Thread ZillaYT
I've read the docs and it seems like all of them point me to coding the p/w either on the CLI or in group vars, but I want to do this --- - hosts: server gather_facts: no tasks: - name: Create a file in the server /etc file system file: path: /etc/test.txt state: touch

[ansible-project] Re: When installing Ansible from source, how can I make setup.py install to a certain directory instead of the build directory?

2017-11-10 Thread ZillaYT
2.7 setup.py install On Friday, November 10, 2017 at 12:40:15 PM UTC-5, ZillaYT wrote: > > I was asked to install Ansible from source, so I am though I know I can > "pip install ansible" > > On a RHEL6.x VM. I have Python 2.7.14 and pip 9.0.1 installed. So I > downloaded the

[ansible-project] When installing Ansible from source, how can I make setup.py install to a certain directory instead of the build directory?

2017-11-10 Thread ZillaYT
I was asked to install Ansible from source, so I am though I know I can "pip install ansible" On a RHEL6.x VM. I have Python 2.7.14 and pip 9.0.1 installed. So I downloaded the tarball and extracted it in /path/ansible-source. Now I do $ cd /path/ansible-source $ source ./hacking/env_setup $

[ansible-project] How pass an array of dictionaries to my custom module elegantly?

2017-11-02 Thread ZillaYT
I'm not trying to re-invent the "replace" module that Ansible has. I'm trying to write a (my FIRST) custom module to encapsulate the repetitive Linux source build process, namely, - run ./configure $CONF_OPTS - run make - run make $TARGETS However, i have an outlying case where I have to modify

Re: [ansible-project] How to make ansible use a certain Python path/executable?

2017-11-01 Thread ZillaYT
> > When I test and have to use many different python interpreters to test > with I often don't install and instead invoke ansible like this: > > /usr/bin/python3.5 $(which ansible) --version > > What works best for you will depend on your use case. > > On Nov 1, 2017 8:00

Re: [ansible-project] How to make ansible use a certain Python path/executable?

2017-11-01 Thread ZillaYT
)] On Tuesday, October 31, 2017 at 3:20:04 PM UTC-4, Matt Martz wrote: > > Look at ansible_python_interpreter: > http://docs.ansible.com/ansible/latest/intro_inventory.html#list-of-behavioral-inventory-parameters > > On Tue, Oct 31, 2017 at 2:12 PM, ZillaYT <zil...@gmail.com >

Re: [ansible-project] How to make ansible use a certain Python path/executable?

2017-10-31 Thread ZillaYT
Thanks again! On Tuesday, October 31, 2017 at 3:20:04 PM UTC-4, Matt Martz wrote: > > Look at ansible_python_interpreter: > http://docs.ansible.com/ansible/latest/intro_inventory.html#list-of-behavioral-inventory-parameters > > On Tue, Oct 31, 2017 at 2:12 PM, ZillaYT &l

[ansible-project] How to make ansible use a certain Python path/executable?

2017-10-31 Thread ZillaYT
How do I force Ansible to use a certain version of Python? Is it in the ansible.cfg file? For example, I see via "ansible --version" command that it's using /usr/local/bin/python v2.6.6, but I want it to use /local/python/bin/python v2.7.x for example? -- You received this message because you

Re: [ansible-project] Command passes, but why is result in stderr and not stdout?

2017-10-31 Thread ZillaYT
hat is where python has decided the version output should go. It is >> specifically sent to stderr by the python binary. >> >> On Tue, Oct 31, 2017 at 1:12 PM, ZillaYT <zil...@gmail.com > >> wrote: >> >>> I have the following simple task to check my Pyth

Re: [ansible-project] Command passes, but why is result in stderr and not stdout?

2017-10-31 Thread ZillaYT
vel.net > > wrote: > >> That is where python has decided the version output should go. It is >> specifically sent to stderr by the python binary. >> >> On Tue, Oct 31, 2017 at 1:12 PM, ZillaYT <zil...@gmail.com > >> wrote: >> >>> I h

[ansible-project] Command passes, but why is result in stderr and not stdout?

2017-10-31 Thread ZillaYT
I have the following simple task to check my Python version - name: Check if Python version matches target commadn: "/local/python/bin/python --version" register: python_ver_check - debug: var=python_ver_check and I get TASK [python3 : debug]

Re: [ansible-project] How to setup PATH variable in an Ansible task using the environment module?

2017-10-25 Thread ZillaYT
luding to. Thanks! On Wednesday, October 25, 2017 at 11:59:34 AM UTC-4, ZillaYT wrote: > > Doesn't this say that it is? > > http://docs.ansible.com/ansible/latest/playbooks_environment.html > > On Wednesday, October 25, 2017 at 11:45:13 AM UTC-4, Brian Coca wrote: >> >&

Re: [ansible-project] How to setup PATH variable in an Ansible task using the environment module?

2017-10-25 Thread ZillaYT
Doesn't this say that it is? http://docs.ansible.com/ansible/latest/playbooks_environment.html On Wednesday, October 25, 2017 at 11:45:13 AM UTC-4, Brian Coca wrote: > > environment is NOT a module, its a keyword that test the environment > for your task/action. > > -- > -- > Brian

[ansible-project] How to setup PATH variable in an Ansible task using the environment module?

2017-10-25 Thread ZillaYT
I'm running Ansble v2.4.0.0 in a RHEL7.2 box. I'm trying to setup the PATH variable with the following simple task, but I'm getting a syntax error. tasks/main.yml -- --- - name: Append to PATH variable environment: PATH: /usr/some_other/bin:{{ ansible_env.PATH }} ...or...

Re: [ansible-project] Cannot define a role dependency with source control repository url

2017-10-03 Thread ZillaYT
RTFM <http://docs.ansible.com/ansible/latest/galaxy.html#dependencies> On Tuesday, October 3, 2017 at 1:55:47 PM UTC-4, ZillaYT wrote: > > I'm using ansible v2.3.2.0. How come I still can't use git repos for role > dependencies in a role's meta/main.xml file? I'm using

[ansible-project] Re: Cannot define a role dependency with source control repository url

2017-10-03 Thread ZillaYT
On Thursday, September 18, 2014 at 5:45:11 AM UTC-4, Vincent Jestin wrote: > > Hello, > > This might be a dummy question but I'm stuck with role dependency > definition in ansible. > > I'd like to use a role defined in a git repository as a dependency for > another role. In the doc

Re: [ansible-project] Cannot define a role dependency with source control repository url

2017-10-03 Thread ZillaYT
I'm using ansible v2.3.2.0. How come I still can't use git repos for role dependencies in a role's meta/main.xml file? I'm using the OP's syntax. dependencies: - { role: 'git+http://git.example.com/repos/role-foo.git '} or dependencies: - {

[ansible-project] Syntax for role dependencies in meta/main.yml?

2017-10-02 Thread ZillaYT
I'm playing with role dependencies using git repos What is the syntax for role dependencies in the role's meta/main.yml file? I've tried meta/main.yml --- dependencies: - role: "git+ssh://git/path/some_repo" or -{role: "git+ssh://git@path/some_repo"} It's an Atlassian Bitbucket repo,

Re: [ansible-project] How to set current directory in ansible.cfg?

2017-10-02 Thread ZillaYT
I know I can... $ ansible-galaxy install -r requirements.yml -p ./roles On Monday, October 2, 2017 at 3:17:01 PM UTC-4, ZillaYT wrote: > > Ah. I want to set it b/c I want to run the following to clone the roles > defined in my current playbook's requirements.yml file in a rol

Re: [ansible-project] How to set current directory in ansible.cfg?

2017-10-02 Thread ZillaYT
Ah. I want to set it b/c I want to run the following to clone the roles defined in my current playbook's requirements.yml file in a roles sub-directory relative to my playbook. $ ansible-galaxy install -r requirements.yml So if my playbook is in /home/myuser/ansible-plays/myplaybook.yml

Re: [ansible-project] How to set current directory in ansible.cfg?

2017-10-02 Thread ZillaYT
Thanks. So what is the recommended way for setting roles_path to be /roles for example? On Monday, October 2, 2017 at 3:01:32 PM UTC-4, Brian Coca wrote: > > In 2.4 and above you can use {{CWD}}, i still don't recommend it as > it is a security risk (cd /tmp; ansible-playbook

[ansible-project] How to set current directory in ansible.cfg?

2017-10-02 Thread ZillaYT
I want to set a roles_path = ${curr_dir}/roles, but how do I set curr_dir to my current directory where I run ansible-playbook command in my ansible.cfg file? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group

Re: [ansible-project] How do I use a variable in an inventory file in a template

2017-04-21 Thread ZillaYT
rver = {{ groups['elk-client-0'][0] }} > > > Though I'm a bit confused why you have an elk server in a group called > 'elk-client-0'. > > On 21 April 2017 at 18:13, ZillaYT <zil...@gmail.com > wrote: > >> up vote >> down votefavorite >> <http://st

[ansible-project] How do I use a variable in an inventory file in a template

2017-04-21 Thread ZillaYT
up vote down votefavorite I have this inventory file inventory/hosts_elk [elk-client-0] 10.11.22.22 Now I have a template, and I want to do this elk_server.yml.j2 elk_server

Re: [ansible-project] Re: How can I iterate over a dictionary in a task?

2017-02-14 Thread ZillaYT
Thanks, I'll try this too. On Tuesday, February 14, 2017 at 12:19:30 PM UTC-5, Kai Stian Olstad wrote: > > On 14. feb. 2017 17:54, ZillaYT wrote: > > I posted the same question on Stackoverflow, and got the answer I was > > looking for. Ugly, but it works. > > &g

[ansible-project] Re: How can I iterate over a dictionary in a task?

2017-02-14 Thread ZillaYT
I posted the same question on Stackoverflow, and got the answer I was looking for. Ugly, but it works. http://stackoverflow.com/questions/42167747/how-to-loop-over-this-dictionary-in-ansible On Friday, February 10, 2017 at 4:22:28 PM UTC-5, ZillaYT wrote: > > Say I have the following dict

Re: [ansible-project] How can I iterate over a dictionary in a task?

2017-02-14 Thread ZillaYT
The loop_control documentation doesn't make really explain how I can use it in my case. On Saturday, February 11, 2017 at 4:35:18 AM UTC-5, Kai Stian Olstad wrote: > > On 10. feb. 2017 23:24, ZillaYT wrote: > > Let me as a different question. What If I want to show A

Re: [ansible-project] How can I iterate over a dictionary in a task?

2017-02-10 Thread ZillaYT
, then the values in each key. On Friday, February 10, 2017 at 4:57:23 PM UTC-5, Kai Stian Olstad wrote: > > On 10. feb. 2017 22:22, ZillaYT wrote: > > Say I have the following dictionary? > > > > war_files: > > server1: > > - file1.war > > - file2

[ansible-project] How can I iterate over a dictionary in a task?

2017-02-10 Thread ZillaYT
Say I have the following dictionary? war_files: server1: - file1.war - file2.war server2: - file1.war - file2.war - file3.war Now I want to iterate over this, say a get_url task: - name: Get the files depending on server name get_url: src=http://some_host/{{ what to put here

[ansible-project] How do I use Ansible facts in a custom module?

2016-12-14 Thread ZillaYT
I'm trying to write my first Ansible module. How do I refer to the built-in facts that Ansible gathers during the setup phase? I just want to be able to do this inside my module, for example.I want to be able to do the "when" part in my module. - name: Issue some command command: ls -al /tmp

[ansible-project] Retaining double-quotes in resulting file created from template

2016-11-02 Thread ZillaYT
I have a template that does has this line host_ip = "http://{{ ansible_default_ipv4.address }}" which results into a line in the dest file that has, for example host_ip = http://10.10.10.10 However, how do modify the template so I retain the "" in the resulting file, so it looks like this

Re: [ansible-project] How do I execute ALL the task in a YML file locally?

2016-10-25 Thread ZillaYT
IOW, I want to do all the tasks inside the YML file on my local machine in "one fell swoop." On Tuesday, October 25, 2016 at 11:23:11 AM UTC-4, ZillaYT wrote: > > Examples for delegate_to, local_action, etc. all show them being added per > task. Though this will definitel

Re: [ansible-project] How do I execute ALL the task in a YML file locally?

2016-10-25 Thread ZillaYT
IOW, I want to do all the tasks inside the YML file in "one fell swoop" On Tuesday, October 25, 2016 at 11:23:11 AM UTC-4, ZillaYT wrote: > > Examples for delegate_to, local_action, etc. all show them being added per > task. Though this will definitely accomplish what I want

Re: [ansible-project] How do I execute ALL the task in a YML file locally?

2016-10-25 Thread ZillaYT
t; > On 25-10-16 17:02, ZillaYT wrote: > > I have a role whose main.yml file includes several *.yml files, e.g., > > > > | > > main.yml > > --- > > -include:tasks1.yml > > -include:tasks2.yml > > > > > > t

[ansible-project] How do I execute ALL the task in a YML file locally?

2016-10-25 Thread ZillaYT
I have a role whose main.yml file includes several *.yml files, e.g., main.yml --- - include: tasks1.yml - include: tasks2.yml tasks1.yml --- - name: Create dir file; path=/tmp/dir1 state=dir - name: Create file from template template: src=my_script.sh.j2 dest=/tmp/dir1/my_script.sh

[ansible-project] Re: included handlers in playbook with roles - not firing

2016-10-11 Thread ZillaYT
The fact that a (more particular) role that includes another (more generic) role can not call the handlers of the more generic role really sucks in ansible. Example of a roles structure roles/ ansible_galaxy_apache_role/ handlers/main.yml <--- has restart apache handler

[ansible-project] How to use a gathered fact to get item from a dictionary?

2016-10-11 Thread ZillaYT
I have a dictionary that defines AWS mounts based on IP address aws_efs_mount: - 10.22.100.1: aws_mount_10_22_100_1 - 10.22.100.2: aws_mount_10_22_100_2 Now I want a task that creates an entry in /etc/fstab # The idea is the src value resolves to src=aws_mount_10_22_100_1 for a IP of

[ansible-project] Re: Blockinfile indentation

2016-09-27 Thread ZillaYT
This seems to be broken in Ansible 2.1.1.0. On Thursday, July 28, 2016 at 2:32:40 PM UTC-4, Alli wrote: > > You can use a block indentation indicator > http://www.yaml.org/spec/1.2/spec.html#id2793979 > > e.g: > > - blockinfile: > dest: /etc/postfix/master.cf > insertafter: "^submission

Re: [ansible-project] How to access a certain element of a register variable in a loop

2016-09-26 Thread ZillaYT
esults | selectattr("item","equalto",item) | map(attribute="stdout") | first }}' with_items: - joe - sally - john On Monday, September 26, 2016 at 12:34:33 PM UTC-4, ZillaYT wrote: > > That will list ALL the item.stdout values, not just Sally's. > > On

Re: [ansible-project] How to access a certain element of a register variable in a loop

2016-09-26 Thread ZillaYT
That will list ALL the item.stdout values, not just Sally's. On Monday, September 26, 2016 at 11:46:10 AM UTC-4, Brian Coca wrote: > > I think this is what you want: > > - debug: msg="Sallys hashed pw is {{item.stdout}}" > with_items: "{{hashed_pws.results}}" > > > -- > -- > Brian Coca

[ansible-project] How to access a certain element of a register variable in a loop

2016-09-26 Thread ZillaYT
I discovered the other day that when a register variable is used in a loop, like this - name: Generate pw's for users command: "/some_path/generate_hashed_pw.sh -u {{ item }}" register: hashed_pws with_items: - joe - sally - john the hashed_pws register is a hash that contains a

[ansible-project] Re: register variable value + string

2016-09-26 Thread ZillaYT
I don't think this is possible. I also experimented with this and discovered, as you did, that it may not be possible. On Sunday, September 25, 2016 at 2:48:32 PM UTC-4, Anthony Cheng wrote: > > Does anyone know how I would go about to register values into variable + > string (within a loop),

[ansible-project] Re: Deployment issue

2016-09-23 Thread ZillaYT
Are you able to accomplish what you're trying to do manually? That is, just to check if your username/pw's/credentials, etc. are good to access the git repo? On Friday, September 23, 2016 at 11:29:55 AM UTC-4, Fetigue Gbane wrote: > > Hi, > I am running a deployment on remote node > > PLAY

[ansible-project] Re: How to specify variables to be used in roles?

2016-09-23 Thread ZillaYT
Sorry, the include_vars should be: - include_vars: "vars/vmname{{ windows_ver }}.yml" On Friday, September 23, 2016 at 2:36:58 PM UTC-4, ZillaYT wrote: > > I think I know what you're after. Try this. > > Have two files in ../roles/vms/vars, namely, > > *..

[ansible-project] Re: How to specify variables to be used in roles?

2016-09-23 Thread ZillaYT
I think I know what you're after. Try this. Have two files in ../roles/vms/vars, namely, *../roles/vms/vars/vmname81.yml* --- windows_vms: - Client1 - Client2 - Client3 ...and ... *../roles/vms/vars/vmnames10.yml* --- windows_vms: - Client4 - Client5 Then your role will be this.

[ansible-project] Re: How to specify variables to be used in roles?

2016-09-23 Thread ZillaYT
What is your file structure? You show a vms role, but not a vmcreation role, but yet your playbook includes the vmcreation role? On Friday, September 23, 2016 at 5:25:29 AM UTC-4, Chethan S wrote: > > I am in the process of migrating to Ansible roles model and I have the > following structure -

[ansible-project] Help removing block in file please.

2016-09-23 Thread ZillaYT
I have a file with the following bock of text in it. I have text before and after the text block. logstash: hash: $fj;kdjjfajf;ajKFJ;dfj;dkfja;dfjFJ:LFJj;kj;lfkajs #password is: some_pw I'm trying to remove the block using this code: - name: Delete existing logstash user blockinfile:

Re: [ansible-project] Re: Shell script does NOT run on target system?

2016-09-21 Thread ZillaYT
Nice, thank you. I changed my script accordingly. On Wednesday, September 21, 2016 at 12:32:19 PM UTC-4, Brian Coca wrote: > > next time you might want to do: > > shell: | > > which preserves literal whitespace, vs > > shell: > > > which does not. > > > -- > Brian Coca > -- You

[ansible-project] Re: Shell script does NOT run on target system?

2016-09-21 Thread ZillaYT
mber 21, 2016 at 11:23:49 AM UTC-4, ZillaYT wrote: > > I have a task that does this > > - name: Generate certs using the example.sh script from zip file > shell: > > cd "/tmp/{{ sg_ssl_dir }}/example-pki-scripts" > chmod +x *.sh > ./example.s

[ansible-project] Shell script does NOT run on target system?

2016-09-21 Thread ZillaYT
I have a task that does this - name: Generate certs using the example.sh script from zip file shell: > cd "/tmp/{{ sg_ssl_dir }}/example-pki-scripts" chmod +x *.sh ./example.sh pw pw Which should generate cert/key pairs, but I don't see them. I do NOT get errors. If I run the

Re: [ansible-project] How do I nest lookup calls

2016-09-16 Thread ZillaYT
That was so obvious that i didn't see it, thanks!!! Yes it worked. I was just wanting to use home_dir somewhere else, but this gets me going. On Friday, September 16, 2016 at 3:27:09 PM UTC-4, Kai Stian Olstad wrote: > > On 16. sep. 2016 20:50, ZillaYT wrote: > > From How to set

[ansible-project] How do I nest lookup calls

2016-09-16 Thread ZillaYT
>From How to set environment variable with value obtained from ~/.aws/credentials? I'm using lookup to get the values from a file off my home directory. But how do I nest the result of one lookup call into a subsequent

[ansible-project] Re: How to set environment variable with value obtained from ~/.aws/credentials?

2016-09-16 Thread ZillaYT
Thanks, I'm reading on lookup now, and that may be the way to go. On Friday, September 16, 2016 at 9:53:25 AM UTC-4, ZillaYT wrote: > > I'm using Ansible's s3 module > <http://docs.ansible.com/ansible/s3_module.html>, and it needs > aws_access_key and aws_secret_key

[ansible-project] How to set environment variable with value obtained from ~/.aws/credentials?

2016-09-16 Thread ZillaYT
I'm using Ansible's s3 module , and it needs aws_access_key and aws_secret_key to work in my AWS environment, even though the page says they're not required. These values are in my $HOME/.aws/credentials file [default] aws_access_key_id =

Re: [ansible-project] How to set a variable in vars/main.yml conditionally?

2016-09-01 Thread ZillaYT
instance in tasks you can say.. > > ```yaml > - include_vars: RedHat6.yml > when: ansible_os_family == "RedHat" and ansible_lsb.major_release == "6" > > - include_vars: RedHat7.yml > when: ansible_os_family == "RedHat" and ansible_lsb.maj

  1   2   >