Ansible: password special characters/symbols

1

In the followin case this extra vars will be correct:

-e "gituser=dgoro gitpass=qweASDzxc1!%40"

Symbol @ can be encoded with %40

- name: IM config | Copy configuration files
  ansible.builtin.git:
    repo: 'http://{{ gituser }}:{{ gitpass }}@gitlab.ru.mgo.su/dit-bitrix/nginx.git'
    dest: /tmp/nginx
    version: devops/DEVOPS-44
!   #   $    &   '   (   )   *   +   ,   /   :   ;   =   ?   @   [   ]
%21 %23 %24 %26 %27 %28 %29 %2A %2B %2C %2F %3A %3B %3D %3F %40 %5B %5D

2

In this case symbol @ can be used as is

- name: IM config | Copy configuration files
  shell: >
    git clone -b devops/DEVOPS-44 http://{{ gituser | urlencode }}:{{gitpass}}@gitlab.ru.mgo.su/dit-bitrix/nginx.git /tmp/nginx
-e "gituser=dgoro gitpass=qweASDzxc1\!@" 

Last updated

Was this helpful?