Details
-
Type: Task
-
Status: Closed (View Workflow)
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: None
-
Labels:None
-
Story Points:0.5
-
Epic Link:
-
Sprint:Spring 8 : 24 Apr to 8 May, Spring 8 : 11 May to 25 May
Description
We need to create a Django admin user for each new App Store.
When provisioning an App Store manually, we do this by running:
- manage.py createsuperuser [adminuser]
When we do this, manage.py asks you to enter a password manually.
Currently, there does not appear to be an option to pass in the password as a command line option.
However, when using manage.py from ansible (using the django_manage role), we cannot easily enter the password manually.
Others have discussed this problem, and a couple of solutions were proposed here:
For this task, design and develop a solution that will allow us to write and run a django_admin or other task that creates the superuser. Include a comment linking to the above StackOverflow post if you write a script or any other new code for this.
See also documentation for the django_admin role:
Describe the solution you think is best in the comments below. We'll implement it under a separate ticket.
Attachments
Issue Links
- blocks
-
IGBF-2365 Create superuser account using ansible
- Closed
Activity
Field | Original Value | New Value |
---|---|---|
Epic Link | IGBF-2323 [ 18477 ] |
Rank | Ranked higher |
Story Points | 1 | 0.5 |
Description |
We need to create a Django admin user for each new App Store.
When provisioning an App Store manually, we do this by running: * manage.py createsuperuser [adminuser] When we do this, manage.py asks you to enter a password manually. Currently, there does not appear to be an option to pass in the password as a command line option. However, when using manage.py from ansible (using the django_manage role), we cannot easily enter the password manually. Others have discussed this problem, and a couple of solutions were proposed here: * https://stackoverflow.com/questions/6244382/how-to-automate-createsuperuser-on-django For this task, design and develop a solution that will allow us to write and run a django_admin or other task that creates the superuser. Include a comment linking to the above StackOverflow post if you write a script or any other new code for this. See also documentation for the django_admin role: * https://docs.ansible.com/ansible/latest/modules/django_manage_module.html To start, investigate solution might be to write a python script that automates this, as suggested in this post: * https://stackoverflow.com/questions/6244382/how-to-automate-createsuperuser-on-django |
We need to create a Django admin user for each new App Store.
When provisioning an App Store manually, we do this by running: * manage.py createsuperuser [adminuser] When we do this, manage.py asks you to enter a password manually. Currently, there does not appear to be an option to pass in the password as a command line option. However, when using manage.py from ansible (using the django_manage role), we cannot easily enter the password manually. Others have discussed this problem, and a couple of solutions were proposed here: * https://stackoverflow.com/questions/6244382/how-to-automate-createsuperuser-on-django For this task, design and develop a solution that will allow us to write and run a django_admin or other task that creates the superuser. Include a comment linking to the above StackOverflow post if you write a script or any other new code for this. See also documentation for the django_admin role: * https://docs.ansible.com/ansible/latest/modules/django_manage_module.html Describe the solution you think is best in the comments below. We'll implement it under a separate ticket. |
Summary | Investigate: How to create a super-user account using ansible | Investigate: How to create Django super-user account using ansible |
Assignee | Chester Dias [ cdias1 ] |
Status | To-Do [ 10305 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | To-Do [ 10305 ] |
Status | To-Do [ 10305 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | Needs 1st Level Review [ 10005 ] |
Assignee | Chester Dias [ cdias1 ] | Ann Loraine [ aloraine ] |
Sprint | Spring 8 : 24 Apr to 8 May [ 93 ] | Spring 8 : 24 Apr to 8 May, Spring 8 : 11 May to 25 May [ 93, 94 ] |
Rank | Ranked higher |
Status | Needs 1st Level Review [ 10005 ] | First Level Review in Progress [ 10301 ] |
Status | First Level Review in Progress [ 10301 ] | Ready for Pull Request [ 10304 ] |
Status | Ready for Pull Request [ 10304 ] | Pull Request Submitted [ 10101 ] |
Status | Pull Request Submitted [ 10101 ] | Reviewing Pull Request [ 10303 ] |
Status | Reviewing Pull Request [ 10303 ] | Merged Needs Testing [ 10002 ] |
Status | Merged Needs Testing [ 10002 ] | Post-merge Testing In Progress [ 10003 ] |
Resolution | Done [ 10000 ] | |
Status | Post-merge Testing In Progress [ 10003 ] | Closed [ 6 ] |
Django module when creating super user assigns a random password. There is no direct way for creating super user
django_manage allows for custom commands.
Solution 1 :
1. Check if a superuser is already present
2. Use command attribute of the django_manage to invoke a shell execution for creating the superuser.
Solution 2(to be used only if the solution 1 fails):
using the shell module execute the super user creation