[ansible-project] Re: How to use external variable inside an ansible inventory file.
Any suggestion guys?? On Tuesday, December 15, 2015 at 1:00:25 PM UTC+5:30, anoop@tarams.com wrote: > > Hi, > > I have an inventory file 'inventory/localhost' and contains; > [localhost] > "{{MYSITE_NAME}}-local.com"ansible_ssh_port= > > > Lets say 'MYSITE_NAME' is a variable defined in some file. I need to > access this inside my inventory file. Please suggest some solution. > -- = DISCLAIMER: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. Further, this e-mail may contain viruses and all reasonable precaution to minimize the risk arising there from is taken by Tarams. Tarams is not liable for any damage sustained by you as a result of any virus in this e-mail. All applicable virus checks should be carried out by you before opening this e-mail or any attachment thereto. Thank you - Tarams Software Technologies Pvt.Ltd. = -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/692cf118-3399-4443-a0db-540184f460fc%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] How to use external variable inside an ansible inventory file.
Hi, I have an inventory file 'inventory/localhost' and contains; [localhost] "{{MYSITE_NAME}}-local.com"ansible_ssh_port= Lets say 'MYSITE_NAME' is a variable defined in some file. I need to access this inside my inventory file. Please suggest some solution. -- = DISCLAIMER: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. Further, this e-mail may contain viruses and all reasonable precaution to minimize the risk arising there from is taken by Tarams. Tarams is not liable for any damage sustained by you as a result of any virus in this e-mail. All applicable virus checks should be carried out by you before opening this e-mail or any attachment thereto. Thank you - Tarams Software Technologies Pvt.Ltd. = -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/cee5bcee-2c51-41c2-879a-71b5d9be0c0b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Re: Access ansible list in python script.
Hi Mike, Thank you for your response. I resolved this by following steps. 1. I quoted the arguments passed with the command like python /home/vagrant/setup/configs/update_installed_app.py "*['django-allauth', 'test']*" 2. In python script I can access it as a string. Then using python 'ast' module i'm converted it into python list. On Thursday, December 10, 2015 at 12:00:49 PM UTC+5:30, anoop@tarams.com wrote: > > Hi, > > I'm calling a python script by passing an ansible list as an argument. > > command: "python /home/vagrant/setup/configs/update_installed_app.py > ['django-allauth', 'test']" > > > But when i print this list in my python script its printing with misplaced > quotes, so i couldnt process it with python. > > ['[django-allauth,', 'test]'] > > > > "rc": 0, > "start": "2015-12-10 06:22:12.327672", > "stderr": "", > "stdout": "['[django-allauth,', 'test]']", > "stdout_lines": [ > "['[django-allauth,', 'test]']" > > Could someone please help me out here. > -- = DISCLAIMER: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. Further, this e-mail may contain viruses and all reasonable precaution to minimize the risk arising there from is taken by Tarams. Tarams is not liable for any damage sustained by you as a result of any virus in this e-mail. All applicable virus checks should be carried out by you before opening this e-mail or any attachment thereto. Thank you - Tarams Software Technologies Pvt.Ltd. = -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/97cf7c88-d751-4e75-9e1e-b03cc33cafcb%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Access ansible list in python script.
Hi, I'm calling a python script by passing an ansible list as an argument. command: "python /home/vagrant/setup/configs/update_installed_app.py ['django-allauth', 'test']" But when i print this list in my python script its printing with misplaced quotes, so i couldnt process it with python. ['[django-allauth,', 'test]'] "rc": 0, "start": "2015-12-10 06:22:12.327672", "stderr": "", "stdout": "['[django-allauth,', 'test]']", "stdout_lines": [ "['[django-allauth,', 'test]']" Could someone please help me out here. -- = DISCLAIMER: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. Further, this e-mail may contain viruses and all reasonable precaution to minimize the risk arising there from is taken by Tarams. Tarams is not liable for any damage sustained by you as a result of any virus in this e-mail. All applicable virus checks should be carried out by you before opening this e-mail or any attachment thereto. Thank you - Tarams Software Technologies Pvt.Ltd. = -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/9a74f54b-234e-4835-a5c1-afd97a0037a5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Re: Ansible createsuperuser with django_manage module.
Hi Chris, I have created a custom django management command to set admin password called 'change_django_admin_password' and calling this through ansible as below; - name: "Run django manage commands for the apps." django_manage: command="{{item.cmd}}" app_path="{{DJANGO_PROJECT.guest.root}}/{{DJANGO_PROJECT.guest.name}}" apps="{{item.apps}}" settings="{{DJANGO_PROJECT.guest.name}}.settings" with_items: - {cmd: "change_django_admin_password --username={{DJANGO_PROJECT.admin.username}} --password={{DJANGO_PROJECT.admin.password}}", apps: ""} This giving me the error mentioned earlier. On Thursday, December 3, 2015 at 10:35:52 AM UTC+5:30, anoop@tarams.com wrote: > > Hi, > > I'm creating a super user for my django application through ansible. > Script is below. > > django_manage: command="createsuperuser --noinput --username=admin --email= > anoop.kol...@tarams.com" app_path={{ django_dir }} > settings={{settings_path}} > > Its creating the super user with some random password. Please let me know > the following at the earliest. > > > 1) Is it possible to set password with the command? > 2) Whats the default password its setting when executing that command? > > = > DISCLAIMER: The information in this message is confidential and may be > legally privileged. It is intended solely for the addressee. Access to this > message by anyone else is unauthorized. If you are not the intended > recipient, any disclosure, copying, or distribution of the message, or any > action or omission taken by you in reliance on it, is prohibited and may be > unlawful. Please immediately contact the sender if you have received this > message in error. Further, this e-mail may contain viruses and all > reasonable precaution to minimize the risk arising there from is taken by > Tarams. Tarams is not liable for any damage sustained by you as a result of > any virus in this e-mail. All applicable virus checks should be carried out > by you before opening this e-mail or any attachment thereto. > Thank you - Tarams Software Technologies Pvt.Ltd. > = > -- = DISCLAIMER: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. Further, this e-mail may contain viruses and all reasonable precaution to minimize the risk arising there from is taken by Tarams. Tarams is not liable for any damage sustained by you as a result of any virus in this e-mail. All applicable virus checks should be carried out by you before opening this e-mail or any attachment thereto. Thank you - Tarams Software Technologies Pvt.Ltd. = -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/aaab5fd2-dfc6-4221-aa38-d4f6e904c0df%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] django_manage with custom django manage commands.
Does ansible 1.7.1 supports execution of custom django manage commands with ansible django_manage module? -- = DISCLAIMER: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. Further, this e-mail may contain viruses and all reasonable precaution to minimize the risk arising there from is taken by Tarams. Tarams is not liable for any damage sustained by you as a result of any virus in this e-mail. All applicable virus checks should be carried out by you before opening this e-mail or any attachment thereto. Thank you - Tarams Software Technologies Pvt.Ltd. = -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f4cd8b35-4c98-4429-8723-7fde33f60d6e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Re: Ansible createsuperuser with django_manage module.
Thanks Chris. Instead of the solution you have suggested, I'm tried to create a custom django manage command. But when i invoked this from ansible through django_manage, its throws an error like the one below. fatal: [djangoskeleton-local.com] => failed to parse: SUDO-SUCCESS-wzpnssbmxbwqvxmfgljczjecbynjytor Traceback (most recent call last): File "/home/vagrant/.ansible/tmp/ansible-tmp-1449209268.07-207237531077051/django_manage", line 1627, in main() File "/home/vagrant/.ansible/tmp/ansible-tmp-1449209268.07-207237531077051/django_manage", line 228, in main if value and param not in command_allowed_param_map[command]: KeyError: 'change_django_admin_password --username=admin --password=tarams123' FATAL: all hosts have already failed -- aborting This command works fine when I tried from python manage.py shell. Could you please suggest. On Thursday, December 3, 2015 at 10:35:52 AM UTC+5:30, anoop@tarams.com wrote: > > Hi, > > I'm creating a super user for my django application through ansible. > Script is below. > > django_manage: command="createsuperuser --noinput --username=admin --email= > anoop.kol...@tarams.com" app_path={{ django_dir }} > settings={{settings_path}} > > Its creating the super user with some random password. Please let me know > the following at the earliest. > > > 1) Is it possible to set password with the command? > 2) Whats the default password its setting when executing that command? > > = > DISCLAIMER: The information in this message is confidential and may be > legally privileged. It is intended solely for the addressee. Access to this > message by anyone else is unauthorized. If you are not the intended > recipient, any disclosure, copying, or distribution of the message, or any > action or omission taken by you in reliance on it, is prohibited and may be > unlawful. Please immediately contact the sender if you have received this > message in error. Further, this e-mail may contain viruses and all > reasonable precaution to minimize the risk arising there from is taken by > Tarams. Tarams is not liable for any damage sustained by you as a result of > any virus in this e-mail. All applicable virus checks should be carried out > by you before opening this e-mail or any attachment thereto. > Thank you - Tarams Software Technologies Pvt.Ltd. > = > -- = DISCLAIMER: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. Further, this e-mail may contain viruses and all reasonable precaution to minimize the risk arising there from is taken by Tarams. Tarams is not liable for any damage sustained by you as a result of any virus in this e-mail. All applicable virus checks should be carried out by you before opening this e-mail or any attachment thereto. Thank you - Tarams Software Technologies Pvt.Ltd. = -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/dc941069-a059-408e-a3ca-47c78730d8da%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-project] Ansible createsuperuser with django_manage module.
Hi, I'm creating a super user for my django application through ansible. Script is below. django_manage: command="createsuperuser --noinput --username=admin --email= anoop.kol...@tarams.com" app_path={{ django_dir }} settings={{settings_path}} Its creating the super user with some random password. Please let me know the following at the earliest. 1) Is it possible to set password with the command? 2) Whats the default password its setting when executing that command? -- = DISCLAIMER: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. Further, this e-mail may contain viruses and all reasonable precaution to minimize the risk arising there from is taken by Tarams. Tarams is not liable for any damage sustained by you as a result of any virus in this e-mail. All applicable virus checks should be carried out by you before opening this e-mail or any attachment thereto. Thank you - Tarams Software Technologies Pvt.Ltd. = -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/bcbd0d27-f686-4ff2-a88d-5c1cbd8aaef6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.