diff options
author | Anton Tananaev <anton@traccar.org> | 2023-02-26 10:49:24 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-02-26 10:49:24 -0800 |
commit | 5284faae8ce9ed077035167063c8d2977d06a8fd (patch) | |
tree | 62dce90db00b620764b5ca5d2041fbf34da82d55 /setup/cloud-init.yaml | |
parent | 9a1cbeb7b754b0147d8ccbc334849fac087d7cda (diff) | |
download | trackermap-server-5284faae8ce9ed077035167063c8d2977d06a8fd.tar.gz trackermap-server-5284faae8ce9ed077035167063c8d2977d06a8fd.tar.bz2 trackermap-server-5284faae8ce9ed077035167063c8d2977d06a8fd.zip |
Add cloud-init example
Diffstat (limited to 'setup/cloud-init.yaml')
-rw-r--r-- | setup/cloud-init.yaml | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/setup/cloud-init.yaml b/setup/cloud-init.yaml new file mode 100644 index 000000000..4ca2e3ed2 --- /dev/null +++ b/setup/cloud-init.yaml @@ -0,0 +1,29 @@ +#cloud-config + +write_files: + - content: | + <?xml version='1.0' encoding='UTF-8'?> + <!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'> + <properties> + + <entry key="config.default">./conf/default.xml</entry> + + <entry key='database.driver'>com.mysql.jdbc.Driver</entry> + <entry key='database.url'>jdbc:mysql://localhost/traccar?serverTimezone=UTC&allowPublicKeyRetrieval=true&useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry> + <entry key='database.user'>root</entry> + <entry key='database.password'>root</entry> + + </properties> + path: /root/traccar.xml + +package_update: true +packages: + - unzip + - mysql-server + +runcmd: + - mysql -u root --execute="ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'; GRANT ALL ON *.* TO 'root'@'localhost' WITH GRANT OPTION; FLUSH PRIVILEGES; CREATE DATABASE traccar;" + - wget https://www.traccar.org/download/traccar-linux-64-latest.zip + - unzip traccar-linux-*.zip && ./traccar.run + - cp /root/traccar.xml /opt/traccar/conf/ + - service traccar start |