Linux asterisk 4.15.0-88-generic #88-Ubuntu SMP Tue Feb 11 20:11:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
asterisk*CLI> core show version
Asterisk 17.2.0 built by root @ asterisk on a x86_64 running Linux on 2020-03-02 14:07:52 UTC
Hi, I am using Ansible to install Asterisk and FreePBX 15 on Ubuntu 18.04 LTS.
I would like to be able to create the first admin user account from the CLI instead of having to visit the http interface in a browser and create from there.
Thanks penguinpbx. I was looking for something more unattended. It would be awesome if one could pass a file containing key:values to the install. Or even just pass the first user. So you end up with a task looking like:
Any remaining values could then be set using the command module along with amportal syntax.
Frankly I am surprised nobody thought of it before. It is common for a number of applications to provide such or similar option where any number of settings can be passed to the install.
This gets me past the initial wizard (first) page So I am prompted for normal user auth on loading in the browser. On initial login the second wizard page displays wanting other settings, like lan and timezone, etc. But that is not a problem.
From here on I should be able configure the ami and ari via console and then anything else can be done using the Ansible uri module as suggested by penguinpbx.
INSERT INTO ampusers (username,password_sha1,sections) VALUES (‘admin’,‘$PASSWORDSHA1’,‘*’);
INSERT INTO kvstore_OOBE (key,val,type,id) VALUES (‘completed’,‘{“framework”:“framework”,“soundlang”:“soundlang”}’,‘json-arr’,‘noid’);
UPDATE freepbx_settings set value = ‘America/Los_Angeles’ WHERE keyword =‘PHPTIMEZONE’;
UPDATE freepbx_settings set value = ‘en_US’ WHERE keyword =‘UIDEFAULTLANG’;
UPDATE soundlang_settings set value = ‘en_US’ WHERE keyword =‘language’;
I prefer the command keyword you used in earlier example vs shell keyword. Mostly command just does less than shell. But both support creates parameter, which is handy for error checking.