I trying to install several packages from local machine, which missed in
any repos. Obviously my code will not work, so which is correct way to do
it without setting up my own repos?
May be is there a way to prepare second list with pathnames and extensions
from file_packages list by ansible to use it at yum module?
On Monday, October 6, 2014 6:28:21 PM UTC+6, Michael DeHaan wrote:
>
> Using "with_items" with yum will result in it joining package names with a
> "," and grouping things into one transaction.
>
> As such, when you use "with_items", you can't concatenate strings in the
> parameter name
>
> yum: name={{ item }} state=installed
> with_items: package_list
>
> Assuming you're using a package manager for downloading from repos, you'll
> want to drop the extension anyway.
>
>
> On Mon, Oct 6, 2014 at 8:18 AM, Dmitry Sukhodoyev <[email protected]
> <javascript:>> wrote:
>
>> hello. where is my mistake?
>>
>> yumtest:
>> ---
>> - hosts: test
>> vars:
>> generic_pkg_extension: "rpm"
>> generic_temp_dir: "/var/tmp"
>> file_packages:
>> - "daemontools-0.76-112memphis.x86_64"
>> - "libevent-1.4.13-500.el6.x86_64"
>> - "nginx-1.2.8-2.el6.x86_64"
>> tasks:
>> - name: "uploading packages from file"
>> copy: src="{{item}}.{{generic_pkg_extension}}"
>> dest="{{generic_temp_dir}}/{{item}}.{{generic_pkg_extension}}"
>> with_items: file_packages
>> - name: installing packages from file
>> yum: name="{{generic_temp_dir}}/{{item}}.{{generic_pkg_extension}}"
>> state="present"
>> with_items: file_packages
>>
>> I ran "ansible-playbook -i yumtest yumtest.yaml" and got:
>> PLAY [test]
>> *******************************************************************
>>
>> GATHERING FACTS
>> ***************************************************************
>> ok: [victim]
>>
>> TASK: [uploading packages from file]
>> ******************************************
>> ok: [victim] => (item=daemontools-0.76-112memphis.x86_64)
>> ok: [victim] => (item=libevent-1.4.13-500.el6.x86_64)
>> ok: [victim] => (item=nginx-1.2.8-2.el6.x86_64)
>>
>> TASK: [installing packages from file]
>> *****************************************
>> failed: [victim] =>
>> (item=daemontools-0.76-112memphis.x86_64,libevent-1.4.13-500.el6.x86_64,nginx-1.2.8-2.el6.x86_64)
>>
>> => {"changed": false, "failed": true, "item":
>> "daemontools-0.76-112memphis.x86_64,libevent-1.4.13-500.el6.x86_64,nginx-1.2.8-2.el6.x86_64",
>>
>> "rc": 0, "results": []}
>> msg: No Package matching '/var/tmp/daemontools-0.76-112memphis.x86_64'
>> found available, installed or updated
>>
>> FATAL: all hosts have already failed -- aborting
>>
>> if I leave in file_packages only one element, then result will success,
>> but I need install several packages.
>>
>> --
>> 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 [email protected] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/7f1c2fe5-079f-4563-bf00-ca90f77958f6%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/ansible-project/7f1c2fe5-079f-4563-bf00-ca90f77958f6%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> 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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/2412e9a1-8cc7-4b0d-930f-e98fcab7776e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.