Closed terryaclarke closed 5 years ago
Hi
Haven't tried it, but can't see why it shouldn't work..
The configuration is in /etc/awx/settings.py..
more specific:
DATABASES = {
'default': {
'ATOMIC_REQUESTS': True,
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'awx',
# 'USER': os.getenv("DATABASE_USER", None),
# 'PASSWORD': os.getenv("DATABASE_PASSWORD", None),
# 'HOST': os.getenv("DATABASE_HOST", None),
# 'PORT': os.getenv("DATABASE_PORT", None),
}
}
I tries this and it did not work.
DATABASES = { 'default': { 'ATOMIC_REQUESTS': True, 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'awxDB', 'USER': os.getenv("awxDBsrv", None), 'PASSWORD': os.getenv(awxDBsrv1234, None), 'HOST': os.getenv(la2-dev-awx-101.abc.com, None), 'PORT': os.getenv("5432", None), } }
Here is the error:
[root@la2-dev-awx-101 /]# /opt/awx/bin/awx-manage migrate
Traceback (most recent call last):
File "/opt/awx/bin/awx-manage", line 11, in
Try this instead:
DATABASES = { 'default': { 'ATOMIC_REQUESTS': True, 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'awxDB', 'USER': 'awxDBsrv', 'PASSWORD': 'awxDBsrv1234', 'HOST': 'la2-dev-awx-101.abc.com', 'PORT': '5432', } }
This is the result. Does this look correct?
[root@la2-dev-awx-101 ~]# /opt/awx/bin/awx-manage migrate Operations to perform: Apply all migrations: auth, conf, contenttypes, django_celery_results, main, sessions, sites, social_django, sso, taggit Running migrations: Applying contenttypes.0001_initial... OK Applying contenttypes.0002_remove_content_type_name... OK Applying auth.0001_initial... OK Applying auth.0002_alter_permission_name_max_length... OK Applying auth.0003_alter_user_email_max_length... OK Applying auth.0004_alter_user_username_opts... OK Applying auth.0005_alter_user_last_login_null... OK Applying auth.0006_require_contenttypes_0002... OK Applying auth.0007_alter_validators_add_error_messages... OK Applying auth.0008_alter_user_username_max_length... OK Applying taggit.0001_initial... OK Applying taggit.0002_auto_20150616_2121... OK Applying main.0001_initial... OK Applying main.0002_squashed_v300_release... OK Applying main.0003_squashed_v300_v303_updates... OK Applying main.0004_squashed_v310_release... OK Applying conf.0001_initial... OK Applying conf.0002_v310_copy_tower_settings... OK Applying conf.0003_v310_JSONField_changes... OK Applying conf.0004_v320_reencrypt... OK Applying django_celery_results.0001_initial... OK Applying main.0005_squashed_v310_v313_updates... OK Applying main.0005a_squashed_v310_v313_updates... OK Applying main.0005b_squashed_v310_v313_updates... OK Applying main.0006_v320_release... OK Applying main.0007_v320_data_migrations...2018-06-15 20:33:33,369 DEBUG awx.main.migrations Removing all Rackspace InventorySource from database. 2018-06-15 20:33:33,669 DEBUG awx.main.migrations Removing all Azure Credentials from database. 2018-06-15 20:33:33,967 DEBUG awx.main.migrations Removing all Azure InventorySource from database. 2018-06-15 20:33:34,265 DEBUG awx.main.migrations Removing all InventorySource that have no link to an Inventory from database. OK Applying main.0008_v320_drop_v1_credential_fields... OK Applying main.0009_v330_multi_credential... OK Applying main.0010_saved_launchtime_configs... OK Applying main.0011_blank_start_args... OK Applying main.0012_non_blank_workflow... OK Applying main.0013_move_deprecated_stdout... OK Applying sessions.0001_initial... OK Applying sites.0001_initial... OK Applying sites.0002_alter_domain_unique... OK Applying social_django.0001_initial... OK Applying social_django.0002_add_related_name... OK Applying social_django.0003_alter_email_max_length... OK Applying social_django.0004_auto_20160423_0400... OK Applying social_django.0005_auto_20160727_2333... OK Applying social_django.0006_partial... OK Applying social_django.0007_code_timestamp... OK Applying social_django.0008_partial_timestamp... OK Applying sso.0001_initial... OK Applying sso.0002_expand_provider_options... OK [root@la2-dev-awx-101 ~]#
I did not get this.
[root@awx ~]# echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'root@localhost', 'password')" | sudo -u awx /opt/awx/bin/awx-manage shell [root@awx ~]# sudo -u awx /opt/awx/bin/awx-manage create_preload_data Default organization added. Demo Credential, Inventory, and Job Template added. [root@awx ~]# sudo -u awx /opt/awx/bin/awx-manage provision_instance --hostname=$(hostname) Successfully registered instance awx.sunil.cc (changed: True) [root@awx ~]# sudo -u awx /opt/awx/bin/awx-manage register_queue --queuename=tower --hostnames=$(hostname) Creating instance group tower Added instance awx.sunil.cc to tower (changed: True) [root@awx ~]#
The web page comes up, but the admin and password don't work.
Can you please check the log file, when you try to login??
/var/log/awx/web.log /var/log/nginx/error_log /var/log/nginx/access_log /var/log/messages
Setup look ok...
Maybe try to create a second user: echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin2', 'root@localhost', 'password')" | sudo -u awx /opt/awx/bin/awx-manage shell
Can you point me to a location I can read documentation concerning awx-manage shell. The help feature is not working. When I enter help to view the help pages, I get nothing back.
I entered echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin2', at the command line and received [root@la2-dev-awx-101 ~]# echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin',
Am I missing something?
There was nothing useful in the messages.log. Here are the others.
You need the complete line: echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin2','root@localhost', 'password')" | sudo -u awx /opt/awx/bin/awx-manage shell
I don't think that there is any more docs than this:
https://docs.ansible.com/ansible-tower/latest/html/administration/tower-manage.html
You may also use simplified command:sudo -u awx awx-manage createsuperuserand follow the prompts. From: notifications@github.comSent: June 16, 2018 2:31 PMTo: awx-build@noreply.github.comReply-to: reply@reply.github.comCc: subscribed@noreply.github.comSubject: Re: [MrMEEE/awx-build] Configuring AWX (#20) You need the complete line: echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin2','root@localhost', 'password')" | sudo -u awx /opt/awx/bin/awx-manage shell
—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or mute the thread.
@rthill Thanks for the hint :)
Thanks, I was able to login to the awx. I am having another issue. Extremely slow performance when using AWX with external Postgres instance. Any thoughts? When I try to save a change, it display's the working message and then it does not save the changes.
hmmm.. weird.. any errors in the logs?..
I might try to do a test setup, with a external postgresql..
@terryaclarke I now have a test setup here, with two VMs, one running the Postgres and the other one running the rest..
And it's working great... so the good news is that it's working... the bad news is that we have to figure out what's wrong with your setup...
Found any errors in the logs??
@terryaclarke, can you also post the specs of your VMs please. From: notifications@github.comSent: June 20, 2018 1:27 PMTo: awx-build@noreply.github.comReply-to: reply@reply.github.comCc: raoul.thill@gmail.com; mention@noreply.github.comSubject: Re: [MrMEEE/awx-build] Configuring AWX (#20) @terryaclarke I now have a test setup here, with two VMs, one running the Postgres and the other one running the rest.. And it's working great... so the good news is that it's working... the bad news is that we have to figure out what's wrong with your setup... Found any errors in the logs??
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.
Is the awx-manage migrate suppose to create the DB during the installation. I am wondering if the DB is setup wrong.
Yrs, the migrate command setups the database schema an requires the database and database user exists. As the createsuperuser command did work, I suppose your database is correctly setup. From: notifications@github.comSent: June 21, 2018 1:26 AMTo: awx-build@noreply.github.comReply-to: reply@reply.github.comCc: raoul.thill@gmail.com; mention@noreply.github.comSubject: Re: [MrMEEE/awx-build] Configuring AWX (#20) Is the awx-manage migrate suppose to create the DB during the installation. I am wondering if the DB is setup wrong.
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.
Please reopen if problem persists
Hi,
I want to configure the AWX to use a remote DB. Can you please help me. I need the name of the config file to change, so I can point the AWX to the remote DB.