Mercurial > repos > other > Puppet
comparison modules/mysql/examples/mysql_login_path.pp @ 389:668df4711671
Update MySQL modules
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 03 Jan 2022 17:16:21 +0000 |
parents | |
children | c6c9a2cfcfbd |
comparison
equal
deleted
inserted
replaced
388:750d36241580 | 389:668df4711671 |
---|---|
1 # Debian MySQL Commiunity Server 8.0 | |
2 include apt | |
3 apt::source { 'repo.mysql.com': | |
4 location => 'http://repo.mysql.com/apt/debian', | |
5 release => $::lsbdistcodename, | |
6 repos => 'mysql-8.0', | |
7 key => { | |
8 id => 'A4A9406876FCBD3C456770C88C718D3B5072E1F5', | |
9 server => 'hkp://keyserver.ubuntu.com:80', | |
10 }, | |
11 include => { | |
12 src => false, | |
13 deb => true, | |
14 }, | |
15 notify => Exec['apt-get update'], | |
16 } | |
17 exec { 'apt-get update': | |
18 path => '/usr/bin:/usr/sbin:/bin:/sbin', | |
19 refreshonly => true, | |
20 } | |
21 | |
22 $root_pw = 'password' | |
23 class { 'mysql::server': | |
24 root_password => $root_pw, | |
25 service_name => 'mysql', | |
26 package_name => 'mysql-community-server', | |
27 create_root_my_cnf => false, | |
28 require => [ | |
29 Apt::Source['repo.mysql.com'], | |
30 Exec['apt-get update'] | |
31 ], | |
32 notify => Mysql_login_path['client'], | |
33 } | |
34 | |
35 class { 'mysql::client': | |
36 package_manage => false, | |
37 package_name => 'mysql-community-client', | |
38 require => Class['::mysql::server'], | |
39 } | |
40 | |
41 mysql_login_path { 'client': | |
42 ensure => present, | |
43 host => 'localhost', | |
44 user => 'root', | |
45 password => Sensitive($root_pw), | |
46 socket => '/var/run/mysqld/mysqld.sock', | |
47 owner => root, | |
48 } | |
49 | |
50 mysql_login_path { 'local_dan': | |
51 ensure => present, | |
52 host => '127.0.0.1', | |
53 user => 'dan', | |
54 password => Sensitive('blah'), | |
55 port => 3306, | |
56 owner => root, | |
57 require => Class['::mysql::server'], | |
58 } | |
59 | |
60 mysql_user { 'dan@localhost': | |
61 ensure => present, | |
62 password_hash => mysql::password('blah'), | |
63 require => Mysql_login_path['client'], | |
64 } |