diff --git a/defaults/main.yml b/defaults/main.yml index 59624fe..2e4c57a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -13,6 +13,7 @@ smtp_port: 25 admin_first_name: Admin admin_last_name: Admin +admin_user_name: admin admin_email: foo@example.com admin_password: bar diff --git a/snipeit.yml b/snipeit.yml index 81f9543..784f0b3 100644 --- a/snipeit.yml +++ b/snipeit.yml @@ -1,33 +1,43 @@ --- -- hosts: snipeit +- hosts: snipeit sudo: true vars: snipeit_source: /opt/snipe-it - + snipeit_version: master snipeit_dbname: snipeit snipeit_dbuser: snipeit - snipeit_dbuser_password: secret - smtp_host: smtp.example.com + smtp_host: [] smtp_port: 25 admin_first_name: Admin admin_last_name: Admin - admin_email: foo@example.com - admin_password: bar + admin_email: "{{ lookup('env', 'GIT_AUTHOR_EMAIL') }}" + admin_user_name: "{{ lookup('env', 'USERNAME') }}" disable_default_apache_site: True - run_mysql_on_all_interfaces: False - - # If you want to import users from Active Directory to Snipe-IT, uncomment and modify the below values. - # To import AD users, run /usr/local/bin/import_ad_users.py - - #ldap_uri: 'ldap://dc01.foo.com' - #ldap_admin: 'CN=Administrator,DC=foo,DC=com' - #ldap_passwd: 'your_secret_password' - #users_ou: 'OU=Users,DC=foo,DC=com' + run_mysql_on_all_interfaces: True +# If you want to import users from Active Directory to Snipe-IT, change ldap: to true and modify the below values. +# To import AD users, run /usr/local/bin/import_ad_users.py + ldap: false + ldap_uri: [] + ldap_admin: 'CN=Administrator,DC=foo,DC=com' + ldap_passwd: 'your_secret_password' + users_ou: 'OU=Users,DC=foo,DC=com' + + vars_prompt: + + - name: "snipeit_dbuser_password" + prompt: "Enter snipeit_dbuser_password" + default: "changeme" + private: yes + + - name: "admin_password" + prompt: "Enter admin_password" + default: "changeme" + private: yes roles: - snipeit-ansible diff --git a/tasks/main.yml b/tasks/main.yml index 341147d..32aefb4 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -108,4 +108,4 @@ - name: Install AD Users Import script include: import_ad_users.yml - when: ldap_uri is defined + when: ldap diff --git a/templates/artisan_expect.exp.j2 b/templates/artisan_expect.exp.j2 index ebca7d1..d41a8e9 100644 --- a/templates/artisan_expect.exp.j2 +++ b/templates/artisan_expect.exp.j2 @@ -4,10 +4,10 @@ spawn php artisan app:install expect "Please enter your first name:" {send "{{ admin_first_name }}\r"} expect "Please enter your last name:" {send "{{ admin_last_name }}\r"} -expect "Please enter your user email:" {send "{{ admin_email }}\r"} +expect "Please enter your username:" {send "{{ admin_user_name }}\r"} +expect "Please enter your email:" {send "{{ admin_email }}\r"} expect "Please enter your user password (at least 8 characters):" {send "{{ admin_password }}\r"} -expect "Do you want to seed your database with dummy data? (deafult is yes):" {send "yes\r"} -expect "Do you really wish to run this command?" {send "yes\r"} -expect "Do you really wish to run this command?" {send "yes\r"} +expect "Please confirm your user password:" {send "{{ admin_password }}\r"} +expect "Do you want to seed your database with dummy data? y/N (default is no):" {send "y\r"} -expect eof \ No newline at end of file +expect eof