FAQ
I use script task to change mysql password by mysqladmin; when the password
is an empty string(''), the script task strips it and leads ansible hang
because mysqladmin will prompt for a password

TASK: *[script /usr/bin/mysqladmin -u root password ''*]
************************
<192.168.0.214> ESTABLISH CONNECTION FOR USER: root on PORT 22 TO
192.168.0.214
<192.168.0.214> EXEC /bin/sh -c 'mkdir -p
$HOME/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946 && echo
$HOME/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946'
<192.168.0.214> PUT /usr/bin/mysqladmin TO
/root/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946/mysqladmin
<192.168.0.214> EXEC /bin/sh -c 'chmod +rx
/root/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946/mysqladmin'
<192.168.0.214> EXEC
/root/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946/mysqladmin -u
root password

see command marked in blue does have a "" at last, but the real command in
red strips it.

How can I handle such case?

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/716218cc-12a0-456b-b7d3-3809209d2883%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Erik-jan Riemers at Mar 1, 2015 at 10:20 pm
    Should that not be pointing to a "{{ $var }}" then? How does the task look
    to start with? This is just the output :)

    Op zondag 1 maart 2015 23:15:43 UTC+1 schreef xin zhang:
    I use script task to change mysql password by mysqladmin; when the
    password is an empty string(''), the script task strips it and leads
    ansible hang because mysqladmin will prompt for a password

    TASK: *[script /usr/bin/mysqladmin -u root password ''*]
    ************************
    <192.168.0.214> ESTABLISH CONNECTION FOR USER: root on PORT 22 TO
    192.168.0.214
    <192.168.0.214> EXEC /bin/sh -c 'mkdir -p
    $HOME/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946 && echo
    $HOME/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946'
    <192.168.0.214> PUT /usr/bin/mysqladmin TO
    /root/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946/mysqladmin
    <192.168.0.214> EXEC /bin/sh -c 'chmod +rx
    /root/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946/mysqladmin'
    <192.168.0.214> EXEC
    /root/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946/mysqladmin -u
    root password

    see command marked in blue does have a "" at last, but the real command in
    red strips it.

    How can I handle such case?
    --
    You received this message because you are subscribed to the Google Groups "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/4187b500-015b-4968-b623-320b07b94d40%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Xin zhang at Mar 1, 2015 at 10:22 pm
    The task is like:

    - script: /tmp/mysql.sh

    and mysql.sh is a single line script like:

    /usr/bin/mysqladmin -u root password ''
    On Sunday, March 1, 2015 at 2:20:49 PM UTC-8, Erik-jan Riemers wrote:

    Should that not be pointing to a "{{ $var }}" then? How does the task look
    to start with? This is just the output :)

    Op zondag 1 maart 2015 23:15:43 UTC+1 schreef xin zhang:
    I use script task to change mysql password by mysqladmin; when the
    password is an empty string(''), the script task strips it and leads
    ansible hang because mysqladmin will prompt for a password

    TASK: *[script /usr/bin/mysqladmin -u root password ''*]
    ************************
    <192.168.0.214> ESTABLISH CONNECTION FOR USER: root on PORT 22 TO
    192.168.0.214
    <192.168.0.214> EXEC /bin/sh -c 'mkdir -p
    $HOME/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946 && echo
    $HOME/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946'
    <192.168.0.214> PUT /usr/bin/mysqladmin TO
    /root/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946/mysqladmin
    <192.168.0.214> EXEC /bin/sh -c 'chmod +rx
    /root/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946/mysqladmin'
    <192.168.0.214> EXEC
    /root/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946/mysqladmin -u
    root password

    see command marked in blue does have a "" at last, but the real command
    in red strips it.

    How can I handle such case?
    --
    You received this message because you are subscribed to the Google Groups "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/533a305a-25af-4b3e-88c9-338f4376a1ad%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Erik-Jan Riemers at Mar 1, 2015 at 10:55 pm
    Did you try it with "''" too?

    Op 1 mrt. 2015 om 23:22 heeft xin zhang <xing5820@gmail.com> het volgende geschreven:

    The task is like:

    - script: /tmp/mysql.sh

    and mysql.sh is a single line script like:

    /usr/bin/mysqladmin -u root password ''
    On Sunday, March 1, 2015 at 2:20:49 PM UTC-8, Erik-jan Riemers wrote:
    Should that not be pointing to a "{{ $var }}" then? How does the task look to start with? This is just the output :)

    Op zondag 1 maart 2015 23:15:43 UTC+1 schreef xin zhang:
    I use script task to change mysql password by mysqladmin; when the password is an empty string(''), the script task strips it and leads ansible hang because mysqladmin will prompt for a password

    TASK: [script /usr/bin/mysqladmin -u root password ''] ************************
    <192.168.0.214> ESTABLISH CONNECTION FOR USER: root on PORT 22 TO 192.168.0.214
    <192.168.0.214> EXEC /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946 && echo $HOME/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946'
    <192.168.0.214> PUT /usr/bin/mysqladmin TO /root/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946/mysqladmin
    <192.168.0.214> EXEC /bin/sh -c 'chmod +rx /root/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946/mysqladmin'
    <192.168.0.214> EXEC /root/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946/mysqladmin -u root password

    see command marked in blue does have a "" at last, but the real command in red strips it.

    How can I handle such case?
    --
    You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
    To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/uGKqMP1jAA8/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/533a305a-25af-4b3e-88c9-338f4376a1ad%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/6CFDBFCF-E7A6-4C74-A4DB-C61D74ADAAD0%40binkey.nl.
    For more options, visit https://groups.google.com/d/optout.
  • Xin zhang at Mar 1, 2015 at 11:31 pm
    I tried. It's still not working
    On Sunday, March 1, 2015 at 2:55:55 PM UTC-8, Erik-jan Riemers wrote:

    Did you try it with "''" too?


    Op 1 mrt. 2015 om 23:22 heeft xin zhang <xing...@gmail.com <javascript:>>
    het volgende geschreven:

    The task is like:

    - script: /tmp/mysql.sh

    and mysql.sh is a single line script like:

    /usr/bin/mysqladmin -u root password ''
    On Sunday, March 1, 2015 at 2:20:49 PM UTC-8, Erik-jan Riemers wrote:

    Should that not be pointing to a "{{ $var }}" then? How does the task
    look to start with? This is just the output :)

    Op zondag 1 maart 2015 23:15:43 UTC+1 schreef xin zhang:
    I use script task to change mysql password by mysqladmin; when the
    password is an empty string(''), the script task strips it and leads
    ansible hang because mysqladmin will prompt for a password

    TASK: *[script /usr/bin/mysqladmin -u root password ''*]
    ************************
    <192.168.0.214> ESTABLISH CONNECTION FOR USER: root on PORT 22 TO
    192.168.0.214
    <192.168.0.214> EXEC /bin/sh -c 'mkdir -p
    $HOME/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946 && echo
    $HOME/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946'
    <192.168.0.214> PUT /usr/bin/mysqladmin TO
    /root/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946/mysqladmin
    <192.168.0.214> EXEC /bin/sh -c 'chmod +rx
    /root/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946/mysqladmin'
    <192.168.0.214> EXEC
    /root/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946/mysqladmin -u
    root password

    see command marked in blue does have a "" at last, but the real command
    in red strips it.

    How can I handle such case?
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Ansible Project" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/ansible-project/uGKqMP1jAA8/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    ansible-proje...@googlegroups.com <javascript:>.
    To post to this group, send email to ansible...@googlegroups.com
    <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/ansible-project/533a305a-25af-4b3e-88c9-338f4376a1ad%40googlegroups.com
    <https://groups.google.com/d/msgid/ansible-project/533a305a-25af-4b3e-88c9-338f4376a1ad%40googlegroups.com?utm_medium=email&utm_source=footer>
    .
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/be432bd7-50fa-4c60-a903-c6a3c86cef1f%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Xin zhang at Mar 2, 2015 at 12:21 am
    I tried defining a variable, it's not working too
    On Sun, Mar 1, 2015 at 2:20 PM, Erik-jan Riemers wrote:

    Should that not be pointing to a "{{ $var }}" then? How does the task look
    to start with? This is just the output :)

    Op zondag 1 maart 2015 23:15:43 UTC+1 schreef xin zhang:
    I use script task to change mysql password by mysqladmin; when the
    password is an empty string(''), the script task strips it and leads
    ansible hang because mysqladmin will prompt for a password

    TASK: *[script /usr/bin/mysqladmin -u root password ''*]
    ************************
    <192.168.0.214> ESTABLISH CONNECTION FOR USER: root on PORT 22 TO
    192.168.0.214
    <192.168.0.214> EXEC /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-
    tmp-1462733147.95-186442598016946 && echo $HOME/.ansible/tmp/ansible-
    tmp-1462733147.95-186442598016946'
    <192.168.0.214> PUT /usr/bin/mysqladmin TO /root/.ansible/tmp/ansible-
    tmp-1462733147.95-186442598016946/mysqladmin
    <192.168.0.214> EXEC /bin/sh -c 'chmod +rx /root/.ansible/tmp/ansible-
    tmp-1462733147.95-186442598016946/mysqladmin'
    <192.168.0.214> EXEC /root/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946/mysqladmin
    -u root password

    see command marked in blue does have a "" at last, but the real command
    in red strips it.

    How can I handle such case?
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Ansible Project" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/ansible-project/uGKqMP1jAA8/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/ansible-project/4187b500-015b-4968-b623-320b07b94d40%40googlegroups.com
    <https://groups.google.com/d/msgid/ansible-project/4187b500-015b-4968-b623-320b07b94d40%40googlegroups.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAFUw1qe5VFwkET8skwewX2YiTK%3DsOyzZzeCxX9oAq1%3D7rq4PDw%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Erik-jan Riemers at Mar 2, 2015 at 7:31 am
    Did you try and escape them with \ so say \`\` or \"``\" (just suggestions,
    since i am uncertain of it too) for all we know you might need to quote the
    command even.

    2015-03-02 1:20 GMT+01:00 xin zhang <xing5820@gmail.com>:
    I tried defining a variable, it's not working too
    On Sun, Mar 1, 2015 at 2:20 PM, Erik-jan Riemers wrote:

    Should that not be pointing to a "{{ $var }}" then? How does the task
    look to start with? This is just the output :)

    Op zondag 1 maart 2015 23:15:43 UTC+1 schreef xin zhang:
    I use script task to change mysql password by mysqladmin; when the
    password is an empty string(''), the script task strips it and leads
    ansible hang because mysqladmin will prompt for a password

    TASK: *[script /usr/bin/mysqladmin -u root password ''*]
    ************************
    <192.168.0.214> ESTABLISH CONNECTION FOR USER: root on PORT 22 TO
    192.168.0.214
    <192.168.0.214> EXEC /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-
    tmp-1462733147.95-186442598016946 && echo $HOME/.ansible/tmp/ansible-
    tmp-1462733147.95-186442598016946'
    <192.168.0.214> PUT /usr/bin/mysqladmin TO /root/.ansible/tmp/ansible-
    tmp-1462733147.95-186442598016946/mysqladmin
    <192.168.0.214> EXEC /bin/sh -c 'chmod +rx /root/.ansible/tmp/ansible-
    tmp-1462733147.95-186442598016946/mysqladmin'
    <192.168.0.214> EXEC /root/.ansible/tmp/ansible-tmp-1462733147.95-186442598016946/mysqladmin
    -u root password

    see command marked in blue does have a "" at last, but the real command
    in red strips it.

    How can I handle such case?
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Ansible Project" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/ansible-project/uGKqMP1jAA8/unsubscribe
    .
    To unsubscribe from this group and all its topics, send an email to
    ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/ansible-project/4187b500-015b-4968-b623-320b07b94d40%40googlegroups.com
    <https://groups.google.com/d/msgid/ansible-project/4187b500-015b-4968-b623-320b07b94d40%40googlegroups.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "Ansible Project" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/ansible-project/uGKqMP1jAA8/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/ansible-project/CAFUw1qe5VFwkET8skwewX2YiTK%3DsOyzZzeCxX9oAq1%3D7rq4PDw%40mail.gmail.com
    <https://groups.google.com/d/msgid/ansible-project/CAFUw1qe5VFwkET8skwewX2YiTK%3DsOyzZzeCxX9oAq1%3D7rq4PDw%40mail.gmail.com?utm_medium=email&utm_source=footer>
    .

    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAOsgjcSQhfYsMwe-M3EOprB_gFZQ9VyRn6N0%2BSwoexV9wyQVmw%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupansible-project @
postedMar 1, '15 at 10:15p
activeMar 2, '15 at 7:31a
posts7
users2

2 users in discussion

Xin zhang: 4 posts Erik-jan Riemers: 3 posts

People

Translate

site design / logo © 2022 Grokbase