[ansible-project] Re: tags within included_tasks do not work?

2017-11-02 Thread coolcps
Figured this out, need to use import_tasks or tags don't work under it.  
Reading this 
documentation 
https://docs.ansible.com/ansible/2.4/playbooks_reuse.html#differences-between-static-and-dynamic
 
and not sure if its a bug or meant to be that way.

On Thursday, November 2, 2017 at 4:49:14 PM UTC-7, coo...@gmail.com wrote:
>
> In a playbook I have a file of tasks included, like so:
>
> - include_tasks: uplinks.yml
>
> And within that task file I have a task:
>
>
> - name: configure hosts
>   ios_config:
> commands:
>   - ip host {{ item['name'] }} {{ item['port'] }} {{ 
> interfaces['mgmt']['ip'] }}
>   with_items: "{{ host_entries }}"
>   tags: update_ts_hosts
>
>
>
> If I try to run the playbook with only that tag, no tasks will run. If I 
> move the tag to the included_tasks level, then all tasks under will run. 
>
>
> ie
>
>
> - include_tasks: misc.yml
>
>   tags: update_ts_hosts
>
>
> I would like to be able to pick specific tasks out of included files, is 
> there something I am missing here?  Thanks for any info!
>
>

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4e4e63a7-c4a4-42c5-896e-85cb6d97e5d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] yum module: removing groups failing

2017-11-02 Thread Steve McKuhr
On Tue Oct 31 2017 12:45:54 GMT-0700 (PDT) John Harmon 
 wrote:
> msg":"","rc":0,"results":
> ["@Console internet tools is not installed",
> "@General Purpose Desktop is not installed",
> "@Graphical Administration Tools is not installed",
> "@Graphics Creation Tools is not installed",
> "@Internet Browser is not installed",
> "@KDE Desktop is not installed",
> "@Legacy X Window System compatibility is not installed",
> "@Remote Desktop Clients is not installed",
> "@TeX support is not installed",
> "@Technical Writing is not installed",
> "@X Window System is not installed",
> "@Desktop is not installed",
> "@Dial-up Networking Support is not installed",
> "@Remote Desktop Clients is not installed",
> "Loaded plugins: security\nSetting up Remove Process\nNo Packages 
> marked for removal\n"]}

It looks to me like that's the clue: are any of the groups in 
'with_items' installed?

So although Ansible command completed successfully the yum return code 
is 1 which accounts for a failure:

   [root@leel ~]# dnf remove "@x" ; echo $?
   Warning: Group 'x' is not installed.
   Error: No groups marked for removal.
   1
 
Does that make sense?

-Steve

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/aa282011-d78f-4533-a5f1-b4a332b2a210%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How to control `ignore_errors` with a variable

2017-11-02 Thread Brian Coca
It works for me, using this play:

- hosts: localhost
 gather_facts: false
 vars:
   ignore: false
 tasks:
   - name: with var
 assert:
   that:
 - item < 2
 ignore_errors: '{{ignore|bool}}'
 with_items: [1,2,3]

I get the following output (note the 'ignoring' at the end:

ok: [localhost] => (item=1) => {
   "changed": false,
   "item": 1,
   "msg": "All assertions passed"
}
failed: [localhost] (item=2) => {
   "assertion": "item < 2",
   "changed": false,
   "evaluated_to": false,
   "item": 2
}
failed: [localhost] (item=3) => {
   "assertion": "item < 2",
   "changed": false,
   "evaluated_to": false,
   "item": 3
}
...ignoring





-- 
--
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACVha7cMQyudCkqH5Vg2fArf9a7xpK4gXcPBerUdOnoAKuMzDw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] use fetch module with wild card or best way to grab different name file from several hosts

2017-11-02 Thread Brian Coca
this explains it.
http://docs.ansible.com/ansible/latest/playbooks_variables.html#registered-variables




-- 
--
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACVha7cz5DuNNFHHO5d4gvgoLG77L6wgkAZAH-kxmMg7%3DJKnGg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] tags within included_tasks do not work?

2017-11-02 Thread coolcps
In a playbook I have a file of tasks included, like so:

- include_tasks: uplinks.yml

And within that task file I have a task:


- name: configure hosts
  ios_config:
commands:
  - ip host {{ item['name'] }} {{ item['port'] }} {{ 
interfaces['mgmt']['ip'] }}
  with_items: "{{ host_entries }}"
  tags: update_ts_hosts



If I try to run the playbook with only that tag, no tasks will run. If I 
move the tag to the included_tasks level, then all tasks under will run. 


ie


- include_tasks: misc.yml

  tags: update_ts_hosts


I would like to be able to pick specific tasks out of included files, is there 
something I am missing here?  Thanks for any info!

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a9db896c-07a3-4aac-af71-66325252570f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] use fetch module with wild card or best way to grab different name file from several hosts

2017-11-02 Thread Kent Younge
So how would it look? 

> On Nov 2, 2017, at 6:15 PM, Brian Coca  wrote:
> 
> fetch does not support wildcards, register the data from find and use
> that in loop in fetch
> 
> -- 
> --
> Brian Coca
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Ansible Project" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/ansible-project/Xzhzm-vXteY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/CACVha7d5vsDry8PbMaLiOOoVXwiSkFrZak_SN3VOfxbvP3_qeQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/870BB1A2-F8F7-4A7F-BA0C-D935C4C5B56A%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] use fetch module with wild card or best way to grab different name file from several hosts

2017-11-02 Thread Brian Coca
fetch does not support wildcards, register the data from find and use
that in loop in fetch

-- 
--
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACVha7d5vsDry8PbMaLiOOoVXwiSkFrZak_SN3VOfxbvP3_qeQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: yum module: removing groups failing

2017-11-02 Thread John Harmon
anyone?

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8cd93f18-8de3-4022-9b81-5bc02c8ab9c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] How to write cobbler.ini for multiple cobbler servers

2017-11-02 Thread Joanna Delaporte
I want to set up multiple cobbler servers' hosts in my cobbler.ini to use their 
inventory...how do I do that? 

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a7927cd4-9ae0-4e8f-a84b-82297d39b0df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible expect module error

2017-11-02 Thread Richmond Fiko


Hello,


I use Ansible 2.2.1.0

I try to use ansible expect module with a command:
expect:
command: set password of database
responses:
Admin Password for db_name: 'admin'
Admin Password Confirmation: 'admin'

I receive this error:

fatal: [subdomain..com]: FAILED! => {"changed": false, "failed": true, 
"module_stderr": "Connection to sante.c3-bs.com closed.\r\n", "module_stdout": 
"Traceback (most recent call last):\r\n  File 
\"/tmp/ansible_ys2qrkdy/ansible_module_expect.py\", line 237, in \r\n   
 main()\r\n  File \"/tmp/ansible_ys2qrkdy/ansible_module_expect.py\", line 149, 
in main\r\nresponse = u'%s\\n' % 
value.rstrip('\\n').decode()\r\nAttributeError: 'str' object has no attribute 
'decode'\r\n", "msg": "MODULE FAILURE"}


I don't understand this error can someone help me and give me the right 
responses or right syntaxe for expect command?


-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3c64f344-e74c-41f5-b39f-8fe20f579758%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Fetch remote files, add them to local file

2017-11-02 Thread John Harmon
I ended up going this route:

---
- hosts: "{{ host }}"
  vars:
dest_dir: "/tmp/fetched"
  tasks:
- name: Ensure destination directory exists
  file:
dest: "{{ dest_dir }}"
state: directory
  changed_when: false

- name: Fetch files from remote server
  fetch:
src: "{{item.src}}"
dest: "{{item.dest}}"
flat: yes
  with_items:
- {src: "/etc/security/limits.conf", dest: "{{ dest_dir }}/{{ 
inventory_hostname }}_limits.conf"}
- {src: "/etc/sysctl.conf", dest: "{{ dest_dir }}/{{ 
inventory_hostname }}_sysctl.conf"}
- {src: "/boot/grub/grub.conf", dest: "{{ dest_dir }}/{{ 
inventory_hostname }}_grub.conf"}

- name: Compress results
  archive:
path: "{{ dest_dir }}/"
dest: "{{ dest_dir }}.tar.bz2"
format: bz2
  delegate_to: localhost
  notify:
- Email results
- Cleanup local files



-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ab8ce66c-5ebf-4cb0-83dd-dd671baeb4fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Error on with ansible expect module

2017-11-02 Thread Richmond Fiko
Hello,

I try to use ansible expect module with a command:
expect:
command: set password of database
responses:
Admin Password for db_name: 'admin'
Admin Password Confirmation: 'admin'

I receive this error:

fatal: [subdomain..com]: FAILED! => {"changed": false, "failed": true, 
"module_stderr": "Connection to sante.c3-bs.com closed.\r\n", "module_stdout": 
"Traceback (most recent call last):\r\n  File 
\"/tmp/ansible_ys2qrkdy/ansible_module_expect.py\", line 237, in \r\n   
 main()\r\n  File \"/tmp/ansible_ys2qrkdy/ansible_module_expect.py\", line 149, 
in main\r\nresponse = u'%s\\n' % 
value.rstrip('\\n').decode()\r\nAttributeError: 'str' object has no attribute 
'decode'\r\n", "msg": "MODULE FAILURE"}


I don't understand this error can someone help me and give me the right 
responses or right syntaxe for expect command?

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/012a3814-a89f-4177-b5bf-a49974cc486a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 Makefile (ugh) that 
./configure produces (not my idea), so my steps are now

- run ./configure $CONF_OPTS
- modify Makefile
- run make
- run make $TARGETS

If I was writing above steps using generic Ansible modules, I'd of course 
use the replace module, like so, correct? This will change all the 
instances of "/usr/local" into "/usr/my/local" and "/usr/perl" into 
"/usr/my/perl" in my Makefile

- name: Update Makefile (ugh)
  replace:
dest: "/path_to/Makefile"
regexp: "{{item.old_str}}"
replace: "{{item.new_str}}"
  with_items:
  - {old_str: "/usr/local", new_str: "/usr/my/local"}
  - {old_str: "/local/perl", new_str: "/usr/my/perl"}


I want my module call to look like this. Or is there a better way to 
represent the "modify_regex" parameters?

- name: Run configure, make, and make targets
  config_make_targets:
path: /path_to_source
modify_file: "Makefile"
modify_regex: [
  {old_str: "/usr/local", new_str: "/usr/my/local"},
  {old_str: "/local/perl", new_str: "/usr/my/perl"}
]


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+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/33f9c3fa-9f38-46c5-8be6-57fce225d389%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: How to append to list vars

2017-11-02 Thread Arbab Nazar
Dick, something like this:
http://blog.crisp.se/2016/10/20/maxwenzin/how-to-append-to-lists-in-ansible

On Wednesday, November 1, 2017 at 4:45:27 PM UTC+5, Dick Visser wrote:
>
> Hi 
>
> I have a few use cases where I define a list in group_vars/all.yml, 
> for instance a list of users: 
>
>
> users: 
>   - allen 
>   - bob 
>   - chris 
>   - dick 
>
>
> So this list applies to all hosts in my case. 
>
> But for a specific host, I want to add one entry to the list. 
> The only way I can get that to work is by copying the list in 
> host_vars/somehost/main.yml and just manually add it: 
>
> users: 
>   - allen 
>   - bob 
>   - chris 
>   - dick 
>   - extrauser 
>
> Obviously this is not ideal as any changes made to the first var will 
> have to be manually carried over to the specific instances. 
>
> Is there some way to append items to list vars (or subtract, for that 
> matter)? 
>
> I was hoping to be able to use something like: 
>
> users: "{{ users }} + ['extrauser']" 
>
> But that gives me "recursive loop detected in template string". 
>
> Any other/clean ways to solve this? 
>
>
> Thanks!! 
>
>
> -- 
> Dick Visser 
> GÉANT 
>
> Want to join us? We're hiring: https://www.geant.org/jobs 
>

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/938f2541-e78b-424c-8aab-bb40834a57fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: command module with squiggly braces not working.

2017-11-02 Thread Dan
My workaround that works: (not "dry" yet) but you get the idea.

  command: >
> aws ec2 authorize-security-group-egress --group-id "{{ sg_id }}" 
> --region "{{ region }}" --profile "{{ profile }}" --ip-permissions 
> '[{"IpProtocol": "tcp", "FromPort": 443, "ToPort": 443, "PrefixListIds": 
> [{"PrefixListId": "pl-63a5400a"}]}]'


On Thursday, November 2, 2017 at 2:29:18 PM UTC-4, Dan wrote:
>
> ec2_group (as of Ansible 2.4) doesn't support usage of pl-x (prefix 
> lists) typically employed by VPC endpoints.
>
> So I went down the rabbit hole of doing this via a command module. The 
> command works on the prompt. How do I get this to work?
>
> ERROR! Syntax Error while loading YAML.
>
>
>
>
> The error appears to have been in 
> '/Users/dgirard/Documents/kraken/git/Ansible-aws-security/EC2-Security-Groups/SG-uat.yml'
> : line 2384, column 150, but may
> be elsewhere in the file depending on the exact syntax problem.
>
>
> The offending line appears to be:
>
>
> # aws ec2 authorize-security-group-egress --group-id "{{ sg_id 
> }}" --region "{{ region }}" --profile "{{ profile }}" --ip-permissions 
> '[{"IpProtocol": "tcp", "FromPort": 443, "ToPort": 443, "PrefixListIds": 
> [{"PrefixListId": "pl-63a5400a"}]}]'
>   command: aws ec2 authorize-security-group-egress --group-id "{{ 
> sg_id }}" --region us-east-1 --profile utility --ip-permissions 
> '[{"IpProtocol": 
> "tcp", "FromPort": 443, "ToPort": 443, "PrefixListIds": [{"PrefixListId": 
> "pl-63a5400a"}]}]'
>   
>
> ^ here
> We could be wrong, but this one looks like it might be an issue with
> missing quotes.  Always quote template expression brackets when they
> start a value. For instance:
>
>
> with_items:
>   - {{ foo }}
>
>
> Should be written as:
>
>
> with_items:
>   - "{{ foo }}"
>
>
> exception type: 
> exception: mapping values are not allowed in this context
>   in "", line 2384, column 150
>
>

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/42dc85b3-563f-4ee3-b64e-e454e3a53be3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] command module with squiggly braces not working.

2017-11-02 Thread Dan
ec2_group (as of Ansible 2.4) doesn't support usage of pl-x (prefix 
lists) typically employed by VPC endpoints.

So I went down the rabbit hole of doing this via a command module. The 
command works on the prompt. How do I get this to work?

ERROR! Syntax Error while loading YAML.




The error appears to have been in 
'/Users/dgirard/Documents/kraken/git/Ansible-aws-security/EC2-Security-Groups/SG-uat.yml'
: line 2384, column 150, but may
be elsewhere in the file depending on the exact syntax problem.


The offending line appears to be:


# aws ec2 authorize-security-group-egress --group-id "{{ sg_id }}" 
--region "{{ region }}" --profile "{{ profile }}" --ip-permissions 
'[{"IpProtocol": "tcp", "FromPort": 443, "ToPort": 443, "PrefixListIds": 
[{"PrefixListId": "pl-63a5400a"}]}]'
  command: aws ec2 authorize-security-group-egress --group-id "{{ sg_id 
}}" --region us-east-1 --profile utility --ip-permissions '[{"IpProtocol": 
"tcp", "FromPort": 443, "ToPort": 443, "PrefixListIds": [{"PrefixListId": 
"pl-63a5400a"}]}]'

 ^ 
here
We could be wrong, but this one looks like it might be an issue with
missing quotes.  Always quote template expression brackets when they
start a value. For instance:


with_items:
  - {{ foo }}


Should be written as:


with_items:
  - "{{ foo }}"


exception type: 
exception: mapping values are not allowed in this context
  in "", line 2384, column 150

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/55d2a210-4798-4677-a66c-be1f2b148bff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Fetch remote files, add them to local file

2017-11-02 Thread John Harmon
I have the following playbook but have 2 problems:


   1.  The contents of the file are garbled.  Why is that?  How can I clear 
   it up?
   2.  How can I just grab the contents of the file only?  
   {{file_contents.results.content}} complains

---
- hosts: "{{ host }}"
  tasks:
- name: Fetch files from remote server
  slurp:
src: "{{item.src}}"
  with_items:
- {src: "/etc/security/limits.conf"}
- {src: "/etc/sysctl.conf"}
- {src: "/boot/grub/grub.conf"}
  register: file_contents

#- name: DEBUG
#  debug:
#var: file_contents

- name: Write results
  lineinfile:
dest: "/tmp/hugepages_results.txt"
line: "HOST: {{ansible_nodename}} \n{{file_contents.results}}\n"
insertafter: EOF
create: yes
state: present
  delegate_to: localhost



-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/523126be-72a5-4792-bd14-78db977c321b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] use fetch module with wild card or best way to grab different name file from several hosts

2017-11-02 Thread Kent Younge
Hello, 

I have created a log file using ansible an have named the log file with the 
host name.  I need to fetch that file from all my hosts and put it in a 
directory on the control server. However, it runs fine but does not copy 
the files over.  Here is my cmds. 


- name:  "Find needsreboot.log file" 
   find:
 paths: /dir/
 patterns: "*.needsreboot.log"  I have also tried 
$HOSTNAME-needsreboot.log

-name: 
 fetch: src: /dir/*.needsreboot.log
 dest: /dir on control server/logs
 flat: yes

thank you, 

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e42aa1a7-1b65-481d-98e8-3809125d6e05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Ansible (Problem install PHP)

2017-11-02 Thread Artur001
You right!
I did not see message of Toshlo Kuratoml.

четверг, 2 ноября 2017 г., 18:24:03 UTC+3 пользователь Werner Flamme 
написал:
>
> Artur001 [02.11.2017 16:02]: 
> > This package is present: 
> > 
> > ~/Загрузки$ php -v 
> > PHP 7.1.11-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Oct 27 2017 
> 13:49:56 
> > ) ( NTS ) 
> > Copyright (c) 1997-2017 The PHP Group 
> > Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies 
> > with Zend OPcache v7.1.11-1+ubuntu16.04.1+deb.sury.org+1, Copyright 
> (c) 
> > 1999-2017, by Zend Technologies 
> > 
> > 
>
> Following the error text you sent, you do not try to install 
> php7-opcache, but php7-apache. 
>
> - name: install php requirements for joomla 
>   apt: name=php{{ php.version }}-{{ item }} state=present 
>   with_items: 
> [...] 
> - apcache 
> [...] 
>
> this should read opcache then. 
>
> -- 
>
>
>

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/793bc0a0-9265-49fb-95fa-316006463e10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Unable to wildcard a template destination parameter

2017-11-02 Thread Tim Davidson
Thank you Kai,

That worked. I'm obviously new to Ansible so I'm sure I'll have many more 
questions in the future.

-Tim


On Thursday, November 2, 2017 at 11:44:14 AM UTC-4, Kai Stian Olstad wrote:
>
> On 02. nov. 2017 14:44, Tim Davidson wrote: 
> > Hello, 
> > 
> > I'm trying to read some .csv files, then create config files for each of 
> > the .csv files, based on a template. Reading the files is not a problem. 
> > However, I can't seem to get the destination parameter to work. I would 
> > like the output file to be the name of the original .csv file with a 
> .xml 
> > extension. 
> > 
> > --- 
> > 
> > - name: Read the csv files 
> >find: 
> >  paths: /home/sysadmin/TimsTest1/roles/opengear/files 
> >  patterns: '*.csv' 
> >register: files_matched 
> > 
> > - name: Create OpenGear device configs 
> >template: 
> >  src: "opengear8port.j2" 
> >  dest: "{{ files_matched.files.path | basename | 
> > regex_replace('csv','xml') }}" 
> >with_items: "{{ files_matched.files }}" 
>
>
> When you're using with_items, it takes the first item in 
> files_matched.files and put it in the variable called item, so your dest 
> should be 
>
>   dest: "{{ item.path | basename | regex_replace('csv','xml') }}" 
>
>
> Regex_replace will overwrite csv in the filename too, to avoid that you 
> can use this instead: 
>
>   dest: "{{ (item.path | basename).rsplit('.', 1)[0] }}.csv" 
>
>
> -- 
> Kai Stian Olstad 
>

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a79dc049-8c6c-4333-9fc3-ad625ce125ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] fatal: [localhost]: FAILED! when installing IIS on Windows Server 2016 ec2

2017-11-02 Thread Akim Grudzitsky
I'm trying to install IIS server on the ec2 instance with Windows in AWS.
But getting an error:

fatal: [localhost]: FAILED! => {
"changed": false, 
"failed": true, 
"module_stderr": "", 
"module_stdout": "", 
"msg": "MODULE FAILURE", 
"rc": 0
}



Playbook:

--- # Install IIS Web-Server

- hosts: localhost
  connection: local
  remote_user: test
  become: yes
  gather_facts: no
  vars_files:
  - files/awscreds.yml
  tasks:
  - name: Basic provisioning of two t2.micro EC2 instances
ec2:
  aws_access_key: "{{ aws_id }}"
  aws_secret_key: "{{ aws_key }}"
  region: "{{ aws_region }}"
  image: ami-e3bb7399
  instance_type: t2.micro
  count: 1
  vpc_subnet_id: subnet-112b2c3d
  assign_public_ip: yes
  - name: Install IIS Web-Server with sub features and management tools
win_feature:
  name: Web-Server
  state: present
  restart: True
  include_sub_features: True
  include_management_tools: True






Could you please advise how to fix this?
Thank you.

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c13f900e-0706-441b-a4fd-9778fe72f1c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Unable to wildcard a template destination parameter

2017-11-02 Thread Kai Stian Olstad
On 02. nov. 2017 14:44, Tim Davidson wrote:
> Hello,
> 
> I'm trying to read some .csv files, then create config files for each of
> the .csv files, based on a template. Reading the files is not a problem.
> However, I can't seem to get the destination parameter to work. I would
> like the output file to be the name of the original .csv file with a .xml
> extension.
> 
> ---
> 
> - name: Read the csv files
>find:
>  paths: /home/sysadmin/TimsTest1/roles/opengear/files
>  patterns: '*.csv'
>register: files_matched
> 
> - name: Create OpenGear device configs
>template:
>  src: "opengear8port.j2"
>  dest: "{{ files_matched.files.path | basename |
> regex_replace('csv','xml') }}"
>with_items: "{{ files_matched.files }}"


When you're using with_items, it takes the first item in files_matched.files 
and put it in the variable called item, so your dest should be

  dest: "{{ item.path | basename | regex_replace('csv','xml') }}"


Regex_replace will overwrite csv in the filename too, to avoid that you can use 
this instead:

  dest: "{{ (item.path | basename).rsplit('.', 1)[0] }}.csv"


-- 
Kai Stian Olstad

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/095f51c1-e5b0-5ded-66c3-8a07dc470b02%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Ansible (Problem install PHP)

2017-11-02 Thread Werner Flamme
Artur001 [02.11.2017 16:02]:
> This package is present:
> 
> ~/Загрузки$ php -v
> PHP 7.1.11-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Oct 27 2017 13:49:56
> ) ( NTS )
> Copyright (c) 1997-2017 The PHP Group
> Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
> with Zend OPcache v7.1.11-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 
> 1999-2017, by Zend Technologies
> 
> 

Following the error text you sent, you do not try to install
php7-opcache, but php7-apache.

- name: install php requirements for joomla
  apt: name=php{{ php.version }}-{{ item }} state=present
  with_items:
[...]
- apcache
[...]

this should read opcache then.

-- 


-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ab587fd6-2409-2561-bfc3-0e7d77b8a0f5%40ufz.de.
For more options, visit https://groups.google.com/d/optout.


smime.p7s
Description: S/MIME Cryptographic Signature


[ansible-project] Re: Ansible (Problem install PHP)

2017-11-02 Thread Artur001
This package is present:

~/Загрузки$ php -v
PHP 7.1.11-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Oct 27 2017 13:49:56
) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.11-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 
1999-2017, by Zend Technologies


-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/184a134a-ac16-4e46-809a-d5bb994d37b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Unable to wildcard a template destination parameter

2017-11-02 Thread Tim Davidson
Hello,

I'm trying to read some .csv files, then create config files for each of 
the .csv files, based on a template. Reading the files is not a problem. 
However, I can't seem to get the destination parameter to work. I would 
like the output file to be the name of the original .csv file with a .xml 
extension.

---

- name: Read the csv files
  find:
paths: /home/sysadmin/TimsTest1/roles/opengear/files
patterns: '*.csv'
  register: files_matched

- name: Create OpenGear device configs
  template:
src: "opengear8port.j2"
dest: "{{ files_matched.files.path | basename | 
regex_replace('csv','xml') }}"
  with_items: "{{ files_matched.files }}"


When I run the playbook, I receive the following on the final task:

TASK [opengear : Create OpenGear device configs] 
***
task path: /home/sysadmin/TimsTest1/roles/opengear/tasks/main.yml:9
fatal: [localhost]: FAILED! => {
"failed": true, 
"msg": "the field 'args' has an invalid value, which appears to include 
a variable that is undefined. The error was: 'list object' has no attribute 
'path'\n\nThe error appears to have been in 
'/home/sysadmin/TimsTest1/roles/opengear/tasks/main.yml': line 9, column 3, 
but may\nbe elsewhere in the file depending on the exact syntax 
problem.\n\nThe offending line appears to be:\n\n\n- name: Create OpenGear 
device configs\n  ^ here\n"
}


I can't seem to get the syntax correct on the destination. Any help is 
appreciated.

Thank you

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/30916d81-a107-4e46-b7fe-d938b58619b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] pytest arugment error

2017-11-02 Thread Toshio Kuratomi
Could you go through your shells' history and reporter precisely which
steps from that page you have performed?  It looks like you've missed a
step or two.

On Nov 2, 2017 5:58 AM, "Jae Kim"  wrote:

> Hi
>
>
>
> Following the command in this manual
>
> http://docs.ansible.com/ansible/latest/dev_guide/developing_
> modules_general.html
>
>
>
> When I run the following command
>
> pytest -r a --cov=. --cov-report=html --fulltrace --color yes
> test/units/modules/.../test/my_new_test_module.py
>
>
>
> the follow error message comes out.
>
>
>
> pytest: error: unrecognized arguments: --cov=. --cov-report=html
>
> --
> 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 group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/4c635a56-5e29-4744-8979-431e68af5263%40googlegroups.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAPrnkaSd7rwrba87BAW2s5WnETiLW1Wff15VyXTTqhs%2BnZ%2BTyA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] pytest error message

2017-11-02 Thread Toshio Kuratomi
How are you arranging for ansible to be in your PYTHONPATH?

-Toshio

On Nov 2, 2017 5:58 AM, "Jae Kim"  wrote:

> Hi
>
>
>
> When I run the following command
>
>
>
> pytest -r a -fulltrace --color yest my_new_test_module.py
>
>
>
> I get the following error message.
>
>
>
> = test session starts
> ==
> platform linux -- Python 3.4.5, pytest-3.2.3, py-1.4.34, pluggy-0.4.0
> rootdir: /root/work/mymoduletests, inifile:
> collected 0 items / 1 errors
>
> === short test summary info
> 
> ERROR my_new_test_module.py
>  ERRORS ==
> ==
>  ERROR collecting my_new_test_module.py
> 
> [31mImportError while importing test module '/root/work/mymoduletests/my_n
> ew_test_module.py'.
> Hint: make sure your test modules/packages have valid Python names.
> Traceback:
> my_new_test_module.py:63: in 
> from ansible.module_utils.basic import AnsibleModule
> E   ImportError: No module named 'ansible' [0m
> !!! Interrupted: 1 errors during collection
> 
> === 1 error in 0.13 seconds
> 
>
>
>
>
>
> my_new_test_module.py is
>
>
>
> #!/usr/bin/python
>
> ANSIBLE_METADATA = {
> 'metadata_version': '1.1',
> 'status': ['preview'],
> 'supported_by': 'community'
> }
>
> DOCUMENTATION = '''
> ---
> module: my_sample_module
>
> short_description: This is my sample module
>
> version_added: "2.4"
>
> description:
> - "This is my longer description explaining my sample module"
>
> options:
> name:
> description:
> - This is the message to send to the sample module
> required: true
> new:
> description:
> - Control to demo if the result of this module is changed or
> not
> required: false
>
> extends_documentation_fragment:
> - azure
>
> author:
> - Your Name (@yourhandle)
> '''
>
> EXAMPLES = '''
> # Pass in a message
> - name: Test with a message
>   my_new_test_module:
> name: hello world
>
> # pass in a message and have changed true
> - name: Test with a message and changed output
>   my_new_test_module:
> name: hello world
> new: true
>
> # fail the module
> - name: Test failure of the module
>   my_new_test_module:
> name: fail me
> '''
>
> RETURN = '''
> original_message:
> description: The original name param that was passed in
> type: str
> message:
> description: The output message that the sample module generates
> '''
>
> from ansible.module_utils.basic import AnsibleModule
>
> def run_module():
> # define the available arguments/parameters that a user can pass to
> # the module
> module_args = dict(
> name=dict(type='str', required=True),
> new=dict(type='bool', required=False, default=False)
> )
>
> # seed the result dict in the object
> # we primarily care about changed and state
> # change is if this module effectively modified the target
> # state will include any data that you want your module to pass back
> # for consumption, for example, in a subsequent task
> result = dict(
> changed=False,
> original_message='',
> message=''
> )
>
> # the AnsibleModule object will be our abstraction working with Ansible
> # this includes instantiation, a couple of common attr would be the
> # args/params passed to the execution, as well as if the module
> # supports check mode
> module = AnsibleModule(
> argument_spec=module_args,
> supports_check_mode=True
> )
>
> # if the user is working with this module in only check mode we do not
> # want to make any changes to the environment, just return the current
> # state with no modifications
> if module.check_mode:
> return result
>
> # manipulate or modify the state as needed (this is going to be the
> # part where your module will do what it needs to do)
> result['original_message'] = module.params['name']
> result['message'] = 'goodbye'
>
> # use whatever logic you need to determine whether or not this module
> # made any modifications to your target
> if module.params['new']:
> result['changed'] = True
>
> # during the execution of the module, if there is an exception or a
> # conditional state that effectively causes a failure, run
> # AnsibleModule.fail_json() to pass in the message and the result
> if module.params['name'] == 'fail me':
> module.fail_json(msg='You requested this to fail', **result)
>
> # in the event of a successful module execution, you will want to
> # simple AnsibleModule.exit_json(), passing the key/value results
> module.exit_json(**result)
>
> def main():
> run_module()
>
> if __name__ == '__main__':
>   

[ansible-project] pytest arugment error

2017-11-02 Thread Jae Kim


Hi

 

Following the command in this manual

http://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.html

 

When I run the following command

pytest -r a --cov=. --cov-report=html --fulltrace --color yes 
test/units/modules/.../test/my_new_test_module.py

 

the follow error message comes out.

 

pytest: error: unrecognized arguments: --cov=. --cov-report=html

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4c635a56-5e29-4744-8979-431e68af5263%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] pytest error message

2017-11-02 Thread Jae Kim


Hi

 

When I run the following command

 

pytest -r a -fulltrace --color yest my_new_test_module.py

 

I get the following error message.

 

= test session starts 
==
platform linux -- Python 3.4.5, pytest-3.2.3, py-1.4.34, pluggy-0.4.0
rootdir: /root/work/mymoduletests, inifile:
collected 0 items / 1 errors

=== short test summary info 

ERROR my_new_test_module.py
 ERRORS 

 ERROR collecting my_new_test_module.py 

[31mImportError while importing test module 
'/root/work/mymoduletests/my_new_test_module.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
my_new_test_module.py:63: in 
from ansible.module_utils.basic import AnsibleModule
E   ImportError: No module named 'ansible' [0m
!!! Interrupted: 1 errors during collection 

=== 1 error in 0.13 seconds 


 

 

my_new_test_module.py is

 

#!/usr/bin/python

ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}

DOCUMENTATION = '''
---
module: my_sample_module

short_description: This is my sample module

version_added: "2.4"

description:
- "This is my longer description explaining my sample module"

options:
name:
description:
- This is the message to send to the sample module
required: true
new:
description:
- Control to demo if the result of this module is changed or not
required: false

extends_documentation_fragment:
- azure

author:
- Your Name (@yourhandle)
'''

EXAMPLES = '''
# Pass in a message
- name: Test with a message
  my_new_test_module:
name: hello world

# pass in a message and have changed true
- name: Test with a message and changed output
  my_new_test_module:
name: hello world
new: true

# fail the module
- name: Test failure of the module
  my_new_test_module:
name: fail me
'''

RETURN = '''
original_message:
description: The original name param that was passed in
type: str
message:
description: The output message that the sample module generates
'''

from ansible.module_utils.basic import AnsibleModule

def run_module():
# define the available arguments/parameters that a user can pass to
# the module
module_args = dict(
name=dict(type='str', required=True),
new=dict(type='bool', required=False, default=False)
)

# seed the result dict in the object
# we primarily care about changed and state
# change is if this module effectively modified the target
# state will include any data that you want your module to pass back
# for consumption, for example, in a subsequent task
result = dict(
changed=False,
original_message='',
message=''
)

# the AnsibleModule object will be our abstraction working with Ansible
# this includes instantiation, a couple of common attr would be the
# args/params passed to the execution, as well as if the module
# supports check mode
module = AnsibleModule(
argument_spec=module_args,
supports_check_mode=True
)

# if the user is working with this module in only check mode we do not
# want to make any changes to the environment, just return the current
# state with no modifications
if module.check_mode:
return result

# manipulate or modify the state as needed (this is going to be the
# part where your module will do what it needs to do)
result['original_message'] = module.params['name']
result['message'] = 'goodbye'

# use whatever logic you need to determine whether or not this module
# made any modifications to your target
if module.params['new']:
result['changed'] = True

# during the execution of the module, if there is an exception or a
# conditional state that effectively causes a failure, run
# AnsibleModule.fail_json() to pass in the message and the result
if module.params['name'] == 'fail me':
module.fail_json(msg='You requested this to fail', **result)

# in the event of a successful module execution, you will want to
# simple AnsibleModule.exit_json(), passing the key/value results
module.exit_json(**result)

def main():
run_module()

if __name__ == '__main__':
main()

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 

Re: [ansible-project] Re: Ansible (Problem install PHP)

2017-11-02 Thread Mehul Ved
I believe the package you're looking for is php-opcache. It's there in the
ppa too. opcache is the object caching module in php -
http://php.net/manual/en/intro.opcache.php

On Thu, Nov 2, 2017 at 1:12 PM, Artur001  wrote:

> Thank you.
> But problem stays.
>
> TASK [php : install php requirements for joomla]
> ***
> failed: [joomla] (item=[u'php7.1-json', u'php7.1-xml', u'php7.1-mbstring',
> u'php7.1-intl', u'php7.1-apache', u'php7.1-mysql', u'php7.1-pgsql']) => {
> "changed": false, "failed": true, "item": ["php7.1-json", "php7.1-xml",
> "php7.1-mbstring", "php7.1-intl", "php7.1-apache", "php7.1-mysql",
> "php7.1-pgsql"], "msg": "No package matching 'php7.1-apache' is available"
> }
> to retry, use: --limit @/home/artur/php-joomla-vm/provisioning/
> playbook.
>
>
> --
> 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 group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/3df38b0b-4c79-40c9-866c-7c5ad7aca1c8%40googlegroups.
> com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
With Regards,
Mehul Ved

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CADTL0oaT91EPrPrXCKcS7GW%2B1Vd6_NeBXmB7wnGwxmQwidkgtQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible (Problem install PHP)

2017-11-02 Thread Toshio Kuratomi
There's no package named php7.1-apcache in that ppa.  correct the spelling.

Packages in that ppa which start with php7.1 are here
http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/

-Toshio

On Nov 1, 2017 12:37 PM, "Artur001"  wrote:

My main.yml
Введи- name: add php ppa
  apt_repository: repo='ppa:ondrej/php' state=present

- name: update apt cache
  apt: update_cache=yes

- name: install php requirements for joomla
  apt: name=php{{ php.version }}-{{ item }} state=present
  with_items:
- json
- xml
- mbstring
- intl
- apcache
- mysql
- pgsql те код...


Введите код.TASK [php : install php requirements for joomla]
***
failed: [joomla] (item=[u'php7.1-json', u'php7.1-xml', u'php7.1-mbstring', u
'php7.1-intl', u'php7.1-apcache', u'php7.1-mysql', u'php7.1-pgsql']) => {
"changed": false, "failed": true, "item": ["php7.1-json", "php7.1-xml",
"php7.1-mbstring", "php7.1-intl", "php7.1-apcache", "php7.1-mysql",
"php7.1-pgsql"], "msg": "No package matching 'php7.1-apcache' is available"}
to retry, use: --limit @/home/artur/php-joomla-vm/provisioning/playbook.
retry
..

What is it problem?

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/ansible-project/14e225d4-6ab8-4b4a-8666-cf6cfeac5d45%40googlegroups.
com

.
For more options, visit https://groups.google.com/d/optout.

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAPrnkaQ3A6PKZrFzH3Majac34psiJbF0Ty23gdBEtN0mtXimjw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Get user details

2017-11-02 Thread Ravikumar Wagh
Is there any way to get available users in system or an spcific user 
details.

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/67e6f035-9f4c-42ff-8b25-90fa32fd67d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible Unit Test installation error

2017-11-02 Thread Jae Kim
When I run the following command

pip3 install -r ./test/runner/requirements/units.txt

The softwares get installed but in the setup steps I get the following error

failed with error code 1 in /tmp/pip-build- /pycrypto 

Also is there a way to skip already successfully run steps and jump to the step 
in question?

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+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8a0ec64b-c981-4e72-b150-0a577e8fcfd9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible (Problem install PHP)

2017-11-02 Thread Artur001
my project
Project 

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/131c0cee-dbc6-4b82-849a-51dbe847fa07%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible, Gitlab, Chocolatey & Telegraf - Master Playbook / Windows setup

2017-11-02 Thread 'Adam Brush' via Ansible Project
Hi,

I've done another noobie guide for a basic Master Playbook setup for a 
mainly windows based setup.

It details:

   - Creating a folder structure (C:\Ansible\Repo)
   - Pausinh
   - Download some files from out gitlab using win_get_url
   - Run some powershell scripts (install chocolatey and configure local 
   repository)
   - Install telegraf (with chocolatey)
   - copy the telegraf config file in place
   - check the telegraf service is started.


https://controlaltfail.wordpress.com/2017/11/02/ansible-gitlab-chocolatey-and-telegraf-plus-config-files

Any comments, suggestions, feedback would be welcome.

Ansible 2.4


-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1e1818fd-f5ad-49d0-8e62-a281bc113a5f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible (Problem install PHP)

2017-11-02 Thread Artur001
Thank you.
But problem stays.

TASK [php : install php requirements for joomla] 
***
failed: [joomla] (item=[u'php7.1-json', u'php7.1-xml', u'php7.1-mbstring', u
'php7.1-intl', u'php7.1-apache', u'php7.1-mysql', u'php7.1-pgsql']) => {
"changed": false, "failed": true, "item": ["php7.1-json", "php7.1-xml", 
"php7.1-mbstring", "php7.1-intl", "php7.1-apache", "php7.1-mysql", 
"php7.1-pgsql"], "msg": "No package matching 'php7.1-apache' is available"}
to retry, use: --limit @/home/artur/php-joomla-vm/provisioning/playbook.


-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3df38b0b-4c79-40c9-866c-7c5ad7aca1c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] How to control `ignore_errors` with a variable

2017-11-02 Thread guenhter
Hi,

I already opened an issue for my question but I was advised to come here 
first.
The detailed description is available under 
https://github.com/ansible/ansible/issues/32384
To sum it up:

I cannot manage to make the `ignore_errors` work with a variable.
When I use a hardcoded boolean it works, but when I use a boolean variable 
it always evaluated to true (ignore errors)

- hosts: 127.0.0.1
  vars:
ignore_assertion_errors: false
  tasks:
- name: With variable
  assert:
that: item < 2
msg: "{{item}} isn't < 2"
  ignore_errors: ignore_assertion_errors
  with_items:
- 1
- 2

- name: With 'false' as hardcoded boolean
  assert:
that: item < 2
msg: "{{item}} isn't < 2"
  ignore_errors: false
  with_items:
- 1
- 2


I already tried out the following constructs

ignore_errors: "{{ignore_assertion_errors}}"
ignore_errors: ignore_assertion_errors
ignore_errors: "{{ignore_assertion_errors|bool}}"
ignore_errors: ignore_assertion_errors|bool



But always with the same result: the errors of the first task are always 
ignored. 

Can anybody  explain what I'm doing wrong, because from my current  point 
of view this is an error.

cheers

-- 
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 group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2f5b1484-b6d4-4f72-95a7-8932d401667b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.