我想自动创建 awx 超级用户。我正在使用命令
awx-manage createsuperuser --username <NAME>
如果我使用此命令,它会提示输入电子邮件和 2 次密码。有没有办法跳过提示并自动执行。
答案1
借此从命令行创建 Tower 管理员没有提供太多信息,命令
/etc/tower# awx-manage help createsuperuser
报告一个选项
usage: awx-manage createsuperuser [-h] [--username USERNAME] [--noinput]
[--database DATABASE] [--email EMAIL]
[--version] [-v {0,1,2,3}]
[--settings SETTINGS]
[--pythonpath PYTHONPATH] [--traceback]
[--no-color] [--force-color]
Used to create a superuser.
optional arguments:
--username USERNAME Specifies the login for the superuser.
--noinput, --no-input
Tells Django to NOT prompt the user for input of any
kind. You must use --username with --noinput, along
with an option for any other required field.
Superusers created with --noinput will not be able to
log in until they're given a valid password.
--database DATABASE Specifies the database to use. Default is "default".
--email EMAIL Specifies the email for the superuser.
跳过提示。
awx-manage --username USERNAME --no-input --email EMAIL
至少从 Ansible Tower v3.8 分支开始,更新或设置初始密码似乎可以通过
awx-manage update_password --username='${USERNAME}' --password='${PASSWORD}'