8000 regex_replace does double-replacement · Issue #47838 · ansible/ansible · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
regex_replace does double-replacement #47838
Closed
@hryamzik

Description

@hryamzik
SUMMARY
ISSUE TYPE
  • Bug Report
COMPONENT NAME

regex_replace

ANSIBLE VERSION
ansible 2.7.1
STEPS TO REPRODUCE
- hosts: localhost
  become: no
  gather_facts: no
  tasks:
      - debug:
          msg: "{{ '10.10.10.12' | regex_replace('(.*)', '=\\1:8') }}"
EXPECTED RESULTS
=10.10.10.12:8
ACTUAL RESULTS
=10.10.10.12:8=:8
$ansible-playbook a.yml -vvvv
ansible-playbook 2.7.1
  config file = None
  configured module search path = ['/Users/hryamzik/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/2.7.1/libexec/lib/python3.7/site-packages/ansible
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.7.0 (default, Jun 29 2018, 20:13:13) [Clang 9.1.0 (clang-902.0.39.2)]
No config file found; using defaults
setting up inventory plugins
/etc/ansible/hosts did not meet host_list requirements, check plugin documentation if this is unexpected
Skipping due to inventory source not existing or not being readable by the current user
/etc/ansible/hosts did not meet script requirements, check plugin documentation if this is unexpected
Skipping due to inventory source not existing or not being readable by the current user
/etc/ansible/hosts did not meet yaml requirements, check plugin documentation if this is unexpected
Skipping due to inventory source not existing or not being readable by the current user
/etc/ansible/hosts did not meet ini requirements, check plugin documentation if this is unexpected
/etc/ansible/hosts did not meet auto requirements, check plugin documentation if this is unexpected
 [WARNING]: Unable to parse /etc/ansible/hosts as an inventory source

 [WARNING]: No inventory was parsed, only implicit localhost is available

 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

Loading callback plugin default of type stdout, v2.0 from /usr/local/Cellar/ansible/2.7.1/libexec/lib/python3.7/site-packages/ansible/plugins/callback/default.py

PLAYBOOK: a.yml ***************************************************************************************************************************************************
1 plays in a.yml

PLAY [localhost] **************************************************************************************************************************************************
META: ran handlers

TASK [debug] ******************************************************************************************************************************************************
task path: /private/tmp/a.yml:5
ok: [localhost] => {
    "msg": "=10.10.10.12:8=:8"
}
META: ran handlers
META: ran handlers

PLAY RECAP ********************************************************************************************************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=0

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects_2.7This issue/PR affects Ansible v2.7bugThis issue/PR relates to a bug.has_prThis issue has an associated PR.python3support:coreThis issue/PR relates to code supported by the Ansible Engineering Team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0