Created
June 22, 2017 01:52
-
-
Save hayajo/a3e9cfaddd9369bc8dc85b4d3626d959 to your computer and use it in GitHub Desktop.
ansbileでユーザープロンプトを表示してY/N入力を促すplaybook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
connection: local | |
gather_facts: no | |
vars: | |
ruby_an_api_base_path: /path/to/base/dir | |
ruby_an_api_version: 2.X.Y | |
sudo: no | |
tasks: | |
- name: confirm create a symlink | |
pause: | |
prompt: "Do you want to create a symlink? {{ ruby_an_api_base_path }}/ruby => {{ ruby_an_api_base_path }}/ruby-{{ ruby_an_api_version }} (y/N)" | |
register: yn | |
- name: create a symlink | |
debug: | |
msg: "Create a symlink {{ ruby_an_api_base_path }}/ruby => {{ ruby_an_api_base_path }}/ruby-{{ ruby_an_api_version }}" | |
when: | |
yn.user_input == 'y' or yn.user_input == 'Y' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment