How to pass prompt in ansible?ansible pass shell command result to variableAnsible : fetching remote...
Breaking changes to eieio in Emacs 27?
Canada travel to US using Global Entry
What should I be wary of when insurer is taking a lot of time to decide whether car is repairable or a total loss?
Is there a DSLR/mirorless camera with minimal options like a classic, simple SLR?
Tikz-cd diagram arrow passing under a node - not crossing it
Use 1 9 6 2 in this order to make 75
Housemarks (superimposed & combined letters, heraldry)
What should I discuss with my DM prior to my first game?
How durable are silver inlays on a blade?
Does putting salt first make it easier for attacker to bruteforce the hash?
Wizard clothing for warm weather
Print "N NE E SE S SW W NW"
I've been given a project I can't complete, what should I do?
So a part of my house disappeared... But not because of a chunk resetting
Three questions
Converting from CMYK to RGB (to work with it), then back to CMYK
Why is long-term living in Almost-Earth causing severe health problems?
Command of files and size
NUL delimited variable
Why are ambiguous grammars bad?
How to avoid typing 'git' at the begining of every Git command
Trying to get (more) accurate readings from thermistor (electronics, math, and code inside)
Does the new finding on "reversing a quantum jump mid-flight" rule out any interpretations of QM?
Generate certain list from two lists
How to pass prompt in ansible?
ansible pass shell command result to variableAnsible : fetching remote hostnamesAnsible Task Creates option issueAnsible shell module problemhost_vars not working in AnsibleAnsible shell module empty responseskip some task with prompt in ansibleansible block of codeAnsible configuration filehow to run playbooks in ansible parallel
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I am trying to pass a prompt y in ansible when it executes the below command. When i do manually on server it asks for a prompt. How should i do it with ansible using shell module.Please help with passing the prompt in ansible
ubuntu@ip-xx-xxx-xx-xx:~$ tsm pending-changes apply
This operation will perform a server restart. Are you sure you wish to continue?
(y/n):
My ansible script:
- name: Apply pending configuration changes
shell: source /etc/profile.d/tableau_server.sh && tsm pending-changes apply -u ubuntu -p '{{ tableau_server_admin_password }}' |
expect "This operation will perform a server restart. Are you sure you wish to continue?(y/n)"
send "yn"
args:
executable: /bin/bash
when: inventory_hostname == "xx.xxx.xx.xx"
ansible
bumped to the homepage by Community♦ 13 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I am trying to pass a prompt y in ansible when it executes the below command. When i do manually on server it asks for a prompt. How should i do it with ansible using shell module.Please help with passing the prompt in ansible
ubuntu@ip-xx-xxx-xx-xx:~$ tsm pending-changes apply
This operation will perform a server restart. Are you sure you wish to continue?
(y/n):
My ansible script:
- name: Apply pending configuration changes
shell: source /etc/profile.d/tableau_server.sh && tsm pending-changes apply -u ubuntu -p '{{ tableau_server_admin_password }}' |
expect "This operation will perform a server restart. Are you sure you wish to continue?(y/n)"
send "yn"
args:
executable: /bin/bash
when: inventory_hostname == "xx.xxx.xx.xx"
ansible
bumped to the homepage by Community♦ 13 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
2
Why don't you use theprompt
in Ansible? docs.ansible.com/ansible/latest/user_guide/…
– maulinglawns
Aug 20 '18 at 15:54
1
Looks like you can pass your command an--ignore-prompt
flag to suppress the prompt... onlinehelp.tableau.com/current/server-linux/en-us/…
– filbranden
Aug 20 '18 at 18:18
add a comment |
I am trying to pass a prompt y in ansible when it executes the below command. When i do manually on server it asks for a prompt. How should i do it with ansible using shell module.Please help with passing the prompt in ansible
ubuntu@ip-xx-xxx-xx-xx:~$ tsm pending-changes apply
This operation will perform a server restart. Are you sure you wish to continue?
(y/n):
My ansible script:
- name: Apply pending configuration changes
shell: source /etc/profile.d/tableau_server.sh && tsm pending-changes apply -u ubuntu -p '{{ tableau_server_admin_password }}' |
expect "This operation will perform a server restart. Are you sure you wish to continue?(y/n)"
send "yn"
args:
executable: /bin/bash
when: inventory_hostname == "xx.xxx.xx.xx"
ansible
I am trying to pass a prompt y in ansible when it executes the below command. When i do manually on server it asks for a prompt. How should i do it with ansible using shell module.Please help with passing the prompt in ansible
ubuntu@ip-xx-xxx-xx-xx:~$ tsm pending-changes apply
This operation will perform a server restart. Are you sure you wish to continue?
(y/n):
My ansible script:
- name: Apply pending configuration changes
shell: source /etc/profile.d/tableau_server.sh && tsm pending-changes apply -u ubuntu -p '{{ tableau_server_admin_password }}' |
expect "This operation will perform a server restart. Are you sure you wish to continue?(y/n)"
send "yn"
args:
executable: /bin/bash
when: inventory_hostname == "xx.xxx.xx.xx"
ansible
ansible
asked Aug 20 '18 at 15:46
SwatSwat
1011
1011
bumped to the homepage by Community♦ 13 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 13 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
2
Why don't you use theprompt
in Ansible? docs.ansible.com/ansible/latest/user_guide/…
– maulinglawns
Aug 20 '18 at 15:54
1
Looks like you can pass your command an--ignore-prompt
flag to suppress the prompt... onlinehelp.tableau.com/current/server-linux/en-us/…
– filbranden
Aug 20 '18 at 18:18
add a comment |
2
Why don't you use theprompt
in Ansible? docs.ansible.com/ansible/latest/user_guide/…
– maulinglawns
Aug 20 '18 at 15:54
1
Looks like you can pass your command an--ignore-prompt
flag to suppress the prompt... onlinehelp.tableau.com/current/server-linux/en-us/…
– filbranden
Aug 20 '18 at 18:18
2
2
Why don't you use the
prompt
in Ansible? docs.ansible.com/ansible/latest/user_guide/…– maulinglawns
Aug 20 '18 at 15:54
Why don't you use the
prompt
in Ansible? docs.ansible.com/ansible/latest/user_guide/…– maulinglawns
Aug 20 '18 at 15:54
1
1
Looks like you can pass your command an
--ignore-prompt
flag to suppress the prompt... onlinehelp.tableau.com/current/server-linux/en-us/…– filbranden
Aug 20 '18 at 18:18
Looks like you can pass your command an
--ignore-prompt
flag to suppress the prompt... onlinehelp.tableau.com/current/server-linux/en-us/…– filbranden
Aug 20 '18 at 18:18
add a comment |
1 Answer
1
active
oldest
votes
This is what the ansible expect module is for:
- name: Apply pending configuration changes
expect:
command: /bin/bash -c "source /etc/profile.d/tableau_server.sh && tsm pending-changes apply -u ubuntu -p '{{ tableau_server_admin_password }}'"
responses:
'(y/n):': y
when: inventory_hostname == "xx.xxx.xx.xx"
(Not able to test but something like this is how it should work)
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f463672%2fhow-to-pass-prompt-in-ansible%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This is what the ansible expect module is for:
- name: Apply pending configuration changes
expect:
command: /bin/bash -c "source /etc/profile.d/tableau_server.sh && tsm pending-changes apply -u ubuntu -p '{{ tableau_server_admin_password }}'"
responses:
'(y/n):': y
when: inventory_hostname == "xx.xxx.xx.xx"
(Not able to test but something like this is how it should work)
add a comment |
This is what the ansible expect module is for:
- name: Apply pending configuration changes
expect:
command: /bin/bash -c "source /etc/profile.d/tableau_server.sh && tsm pending-changes apply -u ubuntu -p '{{ tableau_server_admin_password }}'"
responses:
'(y/n):': y
when: inventory_hostname == "xx.xxx.xx.xx"
(Not able to test but something like this is how it should work)
add a comment |
This is what the ansible expect module is for:
- name: Apply pending configuration changes
expect:
command: /bin/bash -c "source /etc/profile.d/tableau_server.sh && tsm pending-changes apply -u ubuntu -p '{{ tableau_server_admin_password }}'"
responses:
'(y/n):': y
when: inventory_hostname == "xx.xxx.xx.xx"
(Not able to test but something like this is how it should work)
This is what the ansible expect module is for:
- name: Apply pending configuration changes
expect:
command: /bin/bash -c "source /etc/profile.d/tableau_server.sh && tsm pending-changes apply -u ubuntu -p '{{ tableau_server_admin_password }}'"
responses:
'(y/n):': y
when: inventory_hostname == "xx.xxx.xx.xx"
(Not able to test but something like this is how it should work)
answered Sep 18 '18 at 9:07
mhuttermhutter
556212
556212
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f463672%2fhow-to-pass-prompt-in-ansible%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Why don't you use the
prompt
in Ansible? docs.ansible.com/ansible/latest/user_guide/…– maulinglawns
Aug 20 '18 at 15:54
1
Looks like you can pass your command an
--ignore-prompt
flag to suppress the prompt... onlinehelp.tableau.com/current/server-linux/en-us/…– filbranden
Aug 20 '18 at 18:18