awxスーパーユーザー自動生成

awxスーパーユーザー自動生成

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}'

おすすめ記事