Ansible graphite-manage syncdb expect - response
up vote
0
down vote
favorite
I'm new to ansible and trying it by writing an ansible playbook for installing graphite, as a part of it I have the graphite-manage syncdb
command which I would like to automate.
I wrote this task to automatically answer to the promts but for some reason it get stuck and breaks on timeout. "msg": "command exceeded timeout"
and it seems like it doesn't send my response to the promted answer.
I though maybe its the format i used and I checked the samples on ansible docs but Its really simple without additional information.
Here is my sample, please take a look:
---
- hosts: localhost
tasks:
- name: graphite-web syncdb
expect:
command: sudo graphite-manage syncdb
responses:
'Would you like to create one now? (yes/no):': 'yes'
'Username (leave blank to use "root"):': 'n'
'Email address:': 'test@test.com'
'Password:': '123123'
'Password (again):': '123123'
This is the log output I recieved:
fatal: [127.0.0.1]: FAILED! =>
"changed": true,
"cmd": "sudo graphite-manage syncdb",
"delta": "0:00:30.108174",
"end": "2018-11-12 07:09:28.017216",
"invocation":
"module_args":
"chdir": null,
"command": "sudo graphite-manage syncdb",
"creates": null,
"echo": false,
"removes": null,
"responses":
"Email address:": "test@test.com",
"Password (again):": "123123",
"Password:": "123123",
"Username (leave blank to use "root"):": "\n",
"Would you like to create one now? (yes/no):": "yes"
,
"timeout": 30
,
"msg": "command exceeded timeout",
"rc": null,
"start": "2018-11-12 07:08:57.909042",
"stdout": "u001b[36;1mOperations to perform:u001b[0mrnu001b[1m Synchronize unmigrated apps: u001b[0maccount, cli, render, whitelist, metrics, url_shortener, dashboard, composer, events, browserrnu001b[1m Apply all migrations: u001b[0madmin, contenttypes, tagging, auth, sessionsrnu001b[36;1mSynchronizing apps without migrations:u001b[0mrn Creating tables...rn Running deferred SQL...rn Installing custom SQL...rnu001b[36;1mRunning migrations:u001b[0mrn No migrations to apply.rnrnYou have installed Django's auth system, and don't have any superusers defined.rnWould you like to create one now? (yes/no): ",
"stdout_lines": [
"u001b[36;1mOperations to perform:u001b[0m",
"u001b[1m Synchronize unmigrated apps: u001b[0maccount, cli, render, whitelist, metrics, url_shortener, dashboard, composer, events, browser",
"u001b[1m Apply all migrations: u001b[0madmin, contenttypes, tagging, auth, sessions",
"u001b[36;1mSynchronizing apps without migrations:u001b[0m",
" Creating tables...",
" Running deferred SQL...",
" Installing custom SQL...",
"u001b[36;1mRunning migrations:u001b[0m",
" No migrations to apply.",
"",
"You have installed Django's auth system, and don't have any superusers defined.",
"Would you like to create one now? (yes/no): "
]
and how you take care of this prompt window using ansible if its possible?
Thanks a lot for the assistance.
ansible ansible-2.x
add a comment |
up vote
0
down vote
favorite
I'm new to ansible and trying it by writing an ansible playbook for installing graphite, as a part of it I have the graphite-manage syncdb
command which I would like to automate.
I wrote this task to automatically answer to the promts but for some reason it get stuck and breaks on timeout. "msg": "command exceeded timeout"
and it seems like it doesn't send my response to the promted answer.
I though maybe its the format i used and I checked the samples on ansible docs but Its really simple without additional information.
Here is my sample, please take a look:
---
- hosts: localhost
tasks:
- name: graphite-web syncdb
expect:
command: sudo graphite-manage syncdb
responses:
'Would you like to create one now? (yes/no):': 'yes'
'Username (leave blank to use "root"):': 'n'
'Email address:': 'test@test.com'
'Password:': '123123'
'Password (again):': '123123'
This is the log output I recieved:
fatal: [127.0.0.1]: FAILED! =>
"changed": true,
"cmd": "sudo graphite-manage syncdb",
"delta": "0:00:30.108174",
"end": "2018-11-12 07:09:28.017216",
"invocation":
"module_args":
"chdir": null,
"command": "sudo graphite-manage syncdb",
"creates": null,
"echo": false,
"removes": null,
"responses":
"Email address:": "test@test.com",
"Password (again):": "123123",
"Password:": "123123",
"Username (leave blank to use "root"):": "\n",
"Would you like to create one now? (yes/no):": "yes"
,
"timeout": 30
,
"msg": "command exceeded timeout",
"rc": null,
"start": "2018-11-12 07:08:57.909042",
"stdout": "u001b[36;1mOperations to perform:u001b[0mrnu001b[1m Synchronize unmigrated apps: u001b[0maccount, cli, render, whitelist, metrics, url_shortener, dashboard, composer, events, browserrnu001b[1m Apply all migrations: u001b[0madmin, contenttypes, tagging, auth, sessionsrnu001b[36;1mSynchronizing apps without migrations:u001b[0mrn Creating tables...rn Running deferred SQL...rn Installing custom SQL...rnu001b[36;1mRunning migrations:u001b[0mrn No migrations to apply.rnrnYou have installed Django's auth system, and don't have any superusers defined.rnWould you like to create one now? (yes/no): ",
"stdout_lines": [
"u001b[36;1mOperations to perform:u001b[0m",
"u001b[1m Synchronize unmigrated apps: u001b[0maccount, cli, render, whitelist, metrics, url_shortener, dashboard, composer, events, browser",
"u001b[1m Apply all migrations: u001b[0madmin, contenttypes, tagging, auth, sessions",
"u001b[36;1mSynchronizing apps without migrations:u001b[0m",
" Creating tables...",
" Running deferred SQL...",
" Installing custom SQL...",
"u001b[36;1mRunning migrations:u001b[0m",
" No migrations to apply.",
"",
"You have installed Django's auth system, and don't have any superusers defined.",
"Would you like to create one now? (yes/no): "
]
and how you take care of this prompt window using ansible if its possible?
Thanks a lot for the assistance.
ansible ansible-2.x
Did expect match any response? Help us to help you.
– Matthew L Daniel
Nov 12 at 0:06
@MatthewLDaniel i've updated the post with the log output details. thanks!
– rivar_
Nov 12 at 7:16
1
As best I can tell from the fine manual, thoseresponses:
lines are regexes, not literals, which means one must be cautious of the special characters?
and()
. Try replacing them with.
and see if that helps:Would you like to create one now. .yes/no.:
– Matthew L Daniel
Nov 12 at 17:24
You are correct, the appear to be regexes, I've fixed this with adding '' before the ? and () characters.
– rivar_
Nov 14 at 8:03
1
Great, and did that fix your problem, or is there more to the question?
– Matthew L Daniel
Nov 14 at 8:06
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm new to ansible and trying it by writing an ansible playbook for installing graphite, as a part of it I have the graphite-manage syncdb
command which I would like to automate.
I wrote this task to automatically answer to the promts but for some reason it get stuck and breaks on timeout. "msg": "command exceeded timeout"
and it seems like it doesn't send my response to the promted answer.
I though maybe its the format i used and I checked the samples on ansible docs but Its really simple without additional information.
Here is my sample, please take a look:
---
- hosts: localhost
tasks:
- name: graphite-web syncdb
expect:
command: sudo graphite-manage syncdb
responses:
'Would you like to create one now? (yes/no):': 'yes'
'Username (leave blank to use "root"):': 'n'
'Email address:': 'test@test.com'
'Password:': '123123'
'Password (again):': '123123'
This is the log output I recieved:
fatal: [127.0.0.1]: FAILED! =>
"changed": true,
"cmd": "sudo graphite-manage syncdb",
"delta": "0:00:30.108174",
"end": "2018-11-12 07:09:28.017216",
"invocation":
"module_args":
"chdir": null,
"command": "sudo graphite-manage syncdb",
"creates": null,
"echo": false,
"removes": null,
"responses":
"Email address:": "test@test.com",
"Password (again):": "123123",
"Password:": "123123",
"Username (leave blank to use "root"):": "\n",
"Would you like to create one now? (yes/no):": "yes"
,
"timeout": 30
,
"msg": "command exceeded timeout",
"rc": null,
"start": "2018-11-12 07:08:57.909042",
"stdout": "u001b[36;1mOperations to perform:u001b[0mrnu001b[1m Synchronize unmigrated apps: u001b[0maccount, cli, render, whitelist, metrics, url_shortener, dashboard, composer, events, browserrnu001b[1m Apply all migrations: u001b[0madmin, contenttypes, tagging, auth, sessionsrnu001b[36;1mSynchronizing apps without migrations:u001b[0mrn Creating tables...rn Running deferred SQL...rn Installing custom SQL...rnu001b[36;1mRunning migrations:u001b[0mrn No migrations to apply.rnrnYou have installed Django's auth system, and don't have any superusers defined.rnWould you like to create one now? (yes/no): ",
"stdout_lines": [
"u001b[36;1mOperations to perform:u001b[0m",
"u001b[1m Synchronize unmigrated apps: u001b[0maccount, cli, render, whitelist, metrics, url_shortener, dashboard, composer, events, browser",
"u001b[1m Apply all migrations: u001b[0madmin, contenttypes, tagging, auth, sessions",
"u001b[36;1mSynchronizing apps without migrations:u001b[0m",
" Creating tables...",
" Running deferred SQL...",
" Installing custom SQL...",
"u001b[36;1mRunning migrations:u001b[0m",
" No migrations to apply.",
"",
"You have installed Django's auth system, and don't have any superusers defined.",
"Would you like to create one now? (yes/no): "
]
and how you take care of this prompt window using ansible if its possible?
Thanks a lot for the assistance.
ansible ansible-2.x
I'm new to ansible and trying it by writing an ansible playbook for installing graphite, as a part of it I have the graphite-manage syncdb
command which I would like to automate.
I wrote this task to automatically answer to the promts but for some reason it get stuck and breaks on timeout. "msg": "command exceeded timeout"
and it seems like it doesn't send my response to the promted answer.
I though maybe its the format i used and I checked the samples on ansible docs but Its really simple without additional information.
Here is my sample, please take a look:
---
- hosts: localhost
tasks:
- name: graphite-web syncdb
expect:
command: sudo graphite-manage syncdb
responses:
'Would you like to create one now? (yes/no):': 'yes'
'Username (leave blank to use "root"):': 'n'
'Email address:': 'test@test.com'
'Password:': '123123'
'Password (again):': '123123'
This is the log output I recieved:
fatal: [127.0.0.1]: FAILED! =>
"changed": true,
"cmd": "sudo graphite-manage syncdb",
"delta": "0:00:30.108174",
"end": "2018-11-12 07:09:28.017216",
"invocation":
"module_args":
"chdir": null,
"command": "sudo graphite-manage syncdb",
"creates": null,
"echo": false,
"removes": null,
"responses":
"Email address:": "test@test.com",
"Password (again):": "123123",
"Password:": "123123",
"Username (leave blank to use "root"):": "\n",
"Would you like to create one now? (yes/no):": "yes"
,
"timeout": 30
,
"msg": "command exceeded timeout",
"rc": null,
"start": "2018-11-12 07:08:57.909042",
"stdout": "u001b[36;1mOperations to perform:u001b[0mrnu001b[1m Synchronize unmigrated apps: u001b[0maccount, cli, render, whitelist, metrics, url_shortener, dashboard, composer, events, browserrnu001b[1m Apply all migrations: u001b[0madmin, contenttypes, tagging, auth, sessionsrnu001b[36;1mSynchronizing apps without migrations:u001b[0mrn Creating tables...rn Running deferred SQL...rn Installing custom SQL...rnu001b[36;1mRunning migrations:u001b[0mrn No migrations to apply.rnrnYou have installed Django's auth system, and don't have any superusers defined.rnWould you like to create one now? (yes/no): ",
"stdout_lines": [
"u001b[36;1mOperations to perform:u001b[0m",
"u001b[1m Synchronize unmigrated apps: u001b[0maccount, cli, render, whitelist, metrics, url_shortener, dashboard, composer, events, browser",
"u001b[1m Apply all migrations: u001b[0madmin, contenttypes, tagging, auth, sessions",
"u001b[36;1mSynchronizing apps without migrations:u001b[0m",
" Creating tables...",
" Running deferred SQL...",
" Installing custom SQL...",
"u001b[36;1mRunning migrations:u001b[0m",
" No migrations to apply.",
"",
"You have installed Django's auth system, and don't have any superusers defined.",
"Would you like to create one now? (yes/no): "
]
and how you take care of this prompt window using ansible if its possible?
Thanks a lot for the assistance.
ansible ansible-2.x
ansible ansible-2.x
edited Nov 14 at 8:26
asked Nov 11 at 10:00
rivar_
278
278
Did expect match any response? Help us to help you.
– Matthew L Daniel
Nov 12 at 0:06
@MatthewLDaniel i've updated the post with the log output details. thanks!
– rivar_
Nov 12 at 7:16
1
As best I can tell from the fine manual, thoseresponses:
lines are regexes, not literals, which means one must be cautious of the special characters?
and()
. Try replacing them with.
and see if that helps:Would you like to create one now. .yes/no.:
– Matthew L Daniel
Nov 12 at 17:24
You are correct, the appear to be regexes, I've fixed this with adding '' before the ? and () characters.
– rivar_
Nov 14 at 8:03
1
Great, and did that fix your problem, or is there more to the question?
– Matthew L Daniel
Nov 14 at 8:06
add a comment |
Did expect match any response? Help us to help you.
– Matthew L Daniel
Nov 12 at 0:06
@MatthewLDaniel i've updated the post with the log output details. thanks!
– rivar_
Nov 12 at 7:16
1
As best I can tell from the fine manual, thoseresponses:
lines are regexes, not literals, which means one must be cautious of the special characters?
and()
. Try replacing them with.
and see if that helps:Would you like to create one now. .yes/no.:
– Matthew L Daniel
Nov 12 at 17:24
You are correct, the appear to be regexes, I've fixed this with adding '' before the ? and () characters.
– rivar_
Nov 14 at 8:03
1
Great, and did that fix your problem, or is there more to the question?
– Matthew L Daniel
Nov 14 at 8:06
Did expect match any response? Help us to help you.
– Matthew L Daniel
Nov 12 at 0:06
Did expect match any response? Help us to help you.
– Matthew L Daniel
Nov 12 at 0:06
@MatthewLDaniel i've updated the post with the log output details. thanks!
– rivar_
Nov 12 at 7:16
@MatthewLDaniel i've updated the post with the log output details. thanks!
– rivar_
Nov 12 at 7:16
1
1
As best I can tell from the fine manual, those
responses:
lines are regexes, not literals, which means one must be cautious of the special characters ?
and ()
. Try replacing them with .
and see if that helps: Would you like to create one now. .yes/no.:
– Matthew L Daniel
Nov 12 at 17:24
As best I can tell from the fine manual, those
responses:
lines are regexes, not literals, which means one must be cautious of the special characters ?
and ()
. Try replacing them with .
and see if that helps: Would you like to create one now. .yes/no.:
– Matthew L Daniel
Nov 12 at 17:24
You are correct, the appear to be regexes, I've fixed this with adding '' before the ? and () characters.
– rivar_
Nov 14 at 8:03
You are correct, the appear to be regexes, I've fixed this with adding '' before the ? and () characters.
– rivar_
Nov 14 at 8:03
1
1
Great, and did that fix your problem, or is there more to the question?
– Matthew L Daniel
Nov 14 at 8:06
Great, and did that fix your problem, or is there more to the question?
– Matthew L Daniel
Nov 14 at 8:06
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- 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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2fstackoverflow.com%2fquestions%2f53247593%2fansible-graphite-manage-syncdb-expect-response%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
Did expect match any response? Help us to help you.
– Matthew L Daniel
Nov 12 at 0:06
@MatthewLDaniel i've updated the post with the log output details. thanks!
– rivar_
Nov 12 at 7:16
1
As best I can tell from the fine manual, those
responses:
lines are regexes, not literals, which means one must be cautious of the special characters?
and()
. Try replacing them with.
and see if that helps:Would you like to create one now. .yes/no.:
– Matthew L Daniel
Nov 12 at 17:24
You are correct, the appear to be regexes, I've fixed this with adding '' before the ? and () characters.
– rivar_
Nov 14 at 8:03
1
Great, and did that fix your problem, or is there more to the question?
– Matthew L Daniel
Nov 14 at 8:06