unarchive, zip and idempotence

Hi,
I have a zip files with 3 jars inside (no directory). When I use
unarchive it always finds diff, even if files already exist.
With simple diff i see:

.f....o..?? bcpkix-jdk15on-1.60.jar
.f....o..?? bcprov-jdk15on-1.60.jar
.f....o..?? doorman.jar

Is that known problem? If not I'll try to prepare a test case for bug report.

Wawrzek

What does your task:playbook exactly look like?

I've played around and the problem is with setting files ownerships. I
created simple example (see below) and attached test.zip example. If
we remove 2 last lines task will be idempotence.

Wawrzek

(attachments)

test.zip (451 Bytes)

I can confirm this behavior, but it's only the owner that causing problems.

So it's a bug in unarchive when using become and the owner parameter is different from root in Ansible 2.8.0 that I tested on.

>>
>> What does your task:playbook exactly look like?
>
> I've played around and the problem is with setting files ownerships.

[...]

I can confirm this behavior, but it's only the owner that causing problems.

So it's a bug in unarchive when using become and the owner parameter is different from root in Ansible 2.8.0 that I tested on.

Thanks Kai,

I'm going to raise a ticket on Github.

Wawrzek

[...]

> I can confirm this behavior, but it's only the owner that causing problems.
>
> So it's a bug in unarchive when using become and the owner parameter is different from root in Ansible 2.8.0 that I tested on.
I'm going to raise a ticket on Github.

FYI the ticket is https://github.com/ansible/ansible/issues/57303

Wawrzek

Thanks to Kai findings (shared in another thread) I can confirm that
following change to Ansible 2.7.2 fixes the problem:

--- unarchive.py.bak 2019-06-04 11:41:24.000000000 +0100
+++ unarchive.py 2019-06-04 11:46:27.000000000 +0100
@@ -316,7 +316,7 @@
         fut_owner = fut_uid = None
         if self.file_args['owner']:
             try:
- tpw = pwd.getpwname(self.file_args['owner'])
+ tpw = pwd.getpwnam(self.file_args['owner'])
             except:
                 try:
                     tpw = pwd.getpwuid(self.file_args['owner'])

I'm going to updated the ticket.

Wawrzek

Clarification - it's ansible 2.7.10

Wawrzek