[ansible-project] Re: Help with blockinfile module running against Proxmox

2018-03-10 Thread Troy Cauble
I found it.  /etc/pve is a non-posix compliant filesystem
https://pve.proxmox.com/wiki/Proxmox_Cluster_File_System_(pmxcfs)
and blockinfile (and many other file modules) do their work in /tmp and end 
with the
equivalent of "cp -a" or "cp -p" which fails to /etc/pve.

Workaround is to copy: to /tmp, do blockinfile: there, "command: cp" back.

-troy

On Saturday, March 10, 2018 at 2:56:08 PM UTC-5, Troy Cauble wrote:
>
> Did you find a solution?  I'm stuck on the same file.  Different contents 
> -- I'm doing idmaps, but same file.
>
> "msg": "Failed to replace file: /tmp/tmpTzm6Bh to /etc/pve/lxc/100.conf: 
> [Errno 1] Operation not permitted: 
> '/etc/pve/lxc/.ansible_tmpONaD0O100.conf'"
>
> -troy
>
> On Monday, February 19, 2018 at 3:05:43 PM UTC-5, saicrazyfire wrote:
>>
>> Hi,
>>
>> I'm trying to create containers in Proxmox via ansible and I've gotten 
>> most of it working. I'm leveraging LXC containers to host Docker containers 
>> (since they're more lightweight, and easier to create). In order to do so, 
>> I need to append a few lines in the configuration of the container.
>>
>> Let's say I'm creating a LXC container with ID 100, the following lines 
>> needs to be added to /etc/pve/lxc/100.conf (courtesy of 
>> https://gist.github.com/kvaps/25f730e0ec39dd2e5749fb6b020e71fc)
>>
>> lxc.apparmor.profile: unconfined
>> lxc.cgroup.devices.allow: a
>> lxc.cap.drop: 
>> lxc.mount.auto: proc:rw sys:rw
>>
>>
>> I have the following task in Ansible
>>
>> - name: Add configs to LXC for Docker via Proxmox host cfg files
>> become: true
>> blockinfile:
>> path: "/etc/pve/lxc/{{ item }}.conf"
>> block: |
>> lxc.apparmor.profile: unconfined
>> lxc.cgroup.devices.allow: a
>> lxc.cap.drop: 
>> lxc.mount.auto: proc:rw sys:rw
>> with_items:
>> - 100
>>
>> but I get this error
>>
>> TASK [Add configs to LXC for Docker via Proxmox host cfg files] 
>> 
>> An exception occurred during task execution. To see the full traceback, 
>> use -vvv. The error was: OSError: [Errno 1] Operation not permitted: 
>> '/etc/pve/lxc/.ansible_tmp8TEvvY100.conf'
>> failed: [192.168.1.6] (item=100) => {"changed": false, "item": 100, 
>> "msg": "Failed to replace file: /tmp/tmpuptjyz to /etc/pve/lxc/100.conf: 
>> [Errno 1] Operation not permitted: 
>> '/etc/pve/lxc/.ansible_tmp8TEvvY100.conf'"}
>>
>> Any help would be appreciated. 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/955b2940-7c93-405a-8464-986a2d052fa6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Help with blockinfile module running against Proxmox

2018-03-10 Thread Troy Cauble
Did you find a solution?  I'm stuck on the same file.  Different contents 
-- I'm doing idmaps, but same file.

"msg": "Failed to replace file: /tmp/tmpTzm6Bh to /etc/pve/lxc/100.conf: 
[Errno 1] Operation not permitted: 
'/etc/pve/lxc/.ansible_tmpONaD0O100.conf'"

-troy

On Monday, February 19, 2018 at 3:05:43 PM UTC-5, saicrazyfire wrote:
>
> Hi,
>
> I'm trying to create containers in Proxmox via ansible and I've gotten 
> most of it working. I'm leveraging LXC containers to host Docker containers 
> (since they're more lightweight, and easier to create). In order to do so, 
> I need to append a few lines in the configuration of the container.
>
> Let's say I'm creating a LXC container with ID 100, the following lines 
> needs to be added to /etc/pve/lxc/100.conf (courtesy of 
> https://gist.github.com/kvaps/25f730e0ec39dd2e5749fb6b020e71fc)
>
> lxc.apparmor.profile: unconfined
> lxc.cgroup.devices.allow: a
> lxc.cap.drop: 
> lxc.mount.auto: proc:rw sys:rw
>
>
> I have the following task in Ansible
>
> - name: Add configs to LXC for Docker via Proxmox host cfg files
> become: true
> blockinfile:
> path: "/etc/pve/lxc/{{ item }}.conf"
> block: |
> lxc.apparmor.profile: unconfined
> lxc.cgroup.devices.allow: a
> lxc.cap.drop: 
> lxc.mount.auto: proc:rw sys:rw
> with_items:
> - 100
>
> but I get this error
>
> TASK [Add configs to LXC for Docker via Proxmox host cfg files] 
> 
> An exception occurred during task execution. To see the full traceback, 
> use -vvv. The error was: OSError: [Errno 1] Operation not permitted: 
> '/etc/pve/lxc/.ansible_tmp8TEvvY100.conf'
> failed: [192.168.1.6] (item=100) => {"changed": false, "item": 100, "msg": 
> "Failed to replace file: /tmp/tmpuptjyz to /etc/pve/lxc/100.conf: [Errno 1] 
> Operation not permitted: '/etc/pve/lxc/.ansible_tmp8TEvvY100.conf'"}
>
> Any help would be appreciated. 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/3abf330c-084f-429b-a67b-76a9cd49882d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Can't find boto for ansible EC2 module

2016-08-11 Thread Troy Cauble
I found the solution elsewhere you can set this via -e

   -e 'ansible_python_interpreter="/usr/bin/env python"'

On Thursday, August 11, 2016 at 3:34:18 PM UTC-4, Troy Cauble wrote:
>
> What can I do if I'm not using an inventory file?  I'm exec-ing from a 
> script with "ansible-playbook -i , ...".
>
> Also, the ansible and ansible-playbook scripts in my_virtualenv_dir/bin 
> start with
> #!/my_virtualenv_dir/bin/python2
>
> So they're using the right python to start...
>

-- 
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/904ab33f-d30d-4d50-b0cb-090ab0096cd2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Can't find boto for ansible EC2 module

2016-08-11 Thread Troy Cauble
What can I do if I'm not using an inventory file?  I'm exec-ing from a 
script with "ansible-playbook -i , ...".

Also, the ansible and ansible-playbook scripts in my_virtualenv_dir/bin 
start with
#!/my_virtualenv_dir/bin/python2

So they're using the right python to start...

-- 
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/78c72b3d-6abc-4971-a839-e75e376e227a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.