Issue 1:
Issue Type:

Bug Report

Ansible Version:

Ansible devel (e32d887)

Ansible Configuration:

Standard ansible.cfg

Environment:

Debian, Ubuntu

Summary:

Ansible converts strings "yes" and "no" into booleans true and false when it is not asked to. This can interfere when user wants to have literal strings yes or no passed through a variable.

Steps To Reproduce:

---
- hosts: localhost
tasks:

- name: Register fact
set_fact:
some_fact: 'yes'

- name: Show fact as is
debug: var=some_fact

- name: Show fact filtered as bool
debug: msg="{{ some_fact | bool }}"

- name: Show fact in string
debug: msg="some_fact is {{ some_fact }}"

- name: Show fact in string as bool
debug: msg="some_fact is {{ some_fact | bool }}"

Expected Results:

PLAY [all] ********************************************************************

GATHERING FACTS ***************************************************************
ok: [localhost]

TASK: [Register fact] *********************************************************
ok: [localhost]

TASK: [Show fact as is] *******************************************************
ok: [localhost] => {
"var": {
"some_fact": "yes"
}
}

TASK: [Show fact filtered as bool] ********************************************
ok: [localhost] => {
"msg": "True"
}

TASK: [Show fact in string] ***************************************************
ok: [localhost] => {
"msg": "some_fact is yes"
}

TASK: [Show fact in string as bool] *******************************************
ok: [localhost] => {
"msg": "some_fact is True"
}

Actual Results:

PLAY ***************************************************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [Register fact] ***********************************************************
ok: [localhost]

TASK [Show fact as is] *********************************************************
ok: [localhost] => {
"changed": false,
"some_fact": true
}

TASK [Show fact filtered as bool] **********************************************
ok: [localhost] => {
"changed": false,
"msg": true
}

TASK [Show fact in string] *****************************************************
ok: [localhost] => {
"changed": false,
"msg": "some_fact is True"
}

TASK [Show fact in string as bool] *********************************************
ok: [localhost] => {
"changed": false,
"msg": "some_fact is True"
}

Issue 2:
ISSUE TYPE

Bug Report

COMPONENT NAME

win_copy

ANSIBLE VERSION

2.3.2

OS / ENVIRONMENT

Control node: Ubuntu 16

Target node: Windows Server 2016

SUMMARY

The documentation states that if the "src" parameter ends with a "/", then the contents of the directory is copied, not the directory itself. However, when using this together with "remote_src" the module seems to be broken.

STEPS TO REPRODUCE

Source folder layout:

PS C:\Users\trond.hindenes> ls F:\softwaredownload\nginx-1.13.3\nginx-1.13.3

Directory: F:\softwaredownload\nginx-1.13.3\nginx-1.13.3

Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 7/23/2017 10:24 AM conf
d----- 7/23/2017 10:24 AM contrib
d----- 7/23/2017 10:24 AM docs
d----- 7/23/2017 10:24 AM html
d----- 7/11/2017 4:30 PM logs
d----- 7/11/2017 4:30 PM temp
------ 7/11/2017 4:28 PM 3066880 nginx.exe

PS C:\Users\trond.hindenes>

playbook:

- name: copy nginx.exe to target dir
win_copy:
src: "F:\\softwaredownload\\nginx-1.13.3\\nginx-1.13.3/"
dest: "F:\\apps\\nginx"
remote_src: yes
force: yes

ansible vvvv output:

changed: [wpm-0101001] => {
"changed": true,
"dest": "F:\\apps\\nginx",
"operation": "folder_copy",
"original_basename": null,
"size": 3943932,
"src": "F:\\softwaredownload\\nginx-1.13.3\\nginx-1.13.3/"
}

EXPECTED RESULTS

The contents of F:\\apps\\nginx should be equal to the contents of F:\\softwaredownload\\nginx-1.13.3\\nginx-1.13.3

ACTUAL RESULTS

The root folder is also copied, so F:\\apps\\nginx only contains one folder, nginx-1.13.3 (which again has the copied files)