Skip to content

Instantly share code, notes, and snippets.

@hayajo
Created June 22, 2017 01:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hayajo/a3e9cfaddd9369bc8dc85b4d3626d959 to your computer and use it in GitHub Desktop.
Save hayajo/a3e9cfaddd9369bc8dc85b4d3626d959 to your computer and use it in GitHub Desktop.
ansbileでユーザープロンプトを表示してY/N入力を促すplaybook
---
- 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