packer-builds

Packer Builds for LXC and Libvirt
git clone https://git.in0rdr.ch/packer-builds.git
Log | Files | Refs | Pull requests | README

mariadb-lxc.json (1354B)


      1 {
      2   "variables": {
      3     "manifest": "manifest.json",
      4     "mysql_bind": "127.0.0.1",
      5     "mysql_root_password": "",
      6     "mysql_additional_users": "\"user1\" \"user2\" \"user3\"",
      7     "mysql_additional_passwords": "\"password1\" \"password2\" \"password3\"",
      8     "mysql_additional_hosts": "\"127.0.0.1\" \"localhost\" \"localhost\""
      9   },
     10   "sensitive-variables": [
     11     "mysql_root_password",
     12     "mysql_additional_passwords"
     13   ],
     14   "builders": [
     15     {
     16       "type": "lxc",
     17       "name": "mariadb",
     18       "config_file": "config/lxc-config",
     19       "template_name": "download",
     20       "template_parameters": ["--dist", "Debian", "--release", "Bullseye", "--arch", "armv7l", "--no-validate"]
     21     }
     22   ],
     23   "provisioners": [
     24     {
     25       "type": "shell",
     26       "script": "scripts/timezone.sh"
     27     },
     28     {
     29       "type": "shell",
     30       "script": "scripts/mariadb.sh",
     31       "environment_vars": [
     32         "MYSQL_BIND={{ user `mysql_bind` }}",
     33         "MYSQL_ROOT_PASSWORD={{ user `mysql_root_password` }}",
     34         "MYSQL_ADDITIONAL_USERS={{ user `mysql_additional_users` }}",
     35         "MYSQL_ADDITIONAL_PASSWORDS={{ user `mysql_additional_passwords` }}",
     36         "MYSQL_ADDITIONAL_HOSTS={{ user `mysql_additional_hosts` }}"
     37       ]
     38     },
     39     {
     40       "type": "shell",
     41       "inline": ["mysql -e \"GRANT ALL PRIVILEGES on db1.* to 'user1'@'localhost';\""]
     42     }
     43   ]
     44 }