#cloud-config write_files: - content: | com.mysql.jdbc.Driver jdbc:mysql://localhost/traccar?zeroDateTimeBehavior=round&serverTimezone=UTC&allowPublicKeyRetrieval=true&useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode='' root root 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