ansible-2.x

Ansible : create a relative symlink

孤街浪徒 提交于 2020-07-31 16:02:46
问题 In my playbook, I need to create a symbolic link for a repo. With command (shell) it may work like this: ########## Create symbolic link - name: Create symbolic link shell : ln -s "{{SOURCE_FOLDER}}" SYMLINK args : chdir : "/opt/application/i99/" when: - ansible_host in groups['ihm'] -> like this my symbolic link is created directly inside i99 repo / SYMLINK -> SOURCE_FOLDER But while doing it with the Ansible file module, like this: ########## Create symbolic link - name: Create symbolic

Ansible : create a relative symlink

六眼飞鱼酱① 提交于 2020-07-31 15:55:30
问题 In my playbook, I need to create a symbolic link for a repo. With command (shell) it may work like this: ########## Create symbolic link - name: Create symbolic link shell : ln -s "{{SOURCE_FOLDER}}" SYMLINK args : chdir : "/opt/application/i99/" when: - ansible_host in groups['ihm'] -> like this my symbolic link is created directly inside i99 repo / SYMLINK -> SOURCE_FOLDER But while doing it with the Ansible file module, like this: ########## Create symbolic link - name: Create symbolic

Ansible stdout Formatting

谁说我不能喝 提交于 2020-07-17 10:44:45
问题 Assuming the below tasks: shell: "some_script.sh" register: "some_script_result" debug: msg: "Output: {{ some_script_result.stdout_lines }} I receive the below output: "msg": "Output: [u'some_value',u'some_value2,u'some_value3]" How do I get the output to print as? "msg": Output: some_value some_value2 some_value3 Ansible version is 2.4.2. Thank you! 回答1: Try this option. You’ll love it. There's a new YAML callback plugin introduced with Ansible 2.5 — meaning any machine running Ansible 2.5.0