Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: modules/discourse_docker/manifests/init.pp

Issue 29427603: Noissue - Configure discourse containers to use smtp on the host system Base URL: https://hg1/infrastructure
Left Patch Set: Created May 2, 2017, 9:23 p.m.
Right Patch Set: use host ip instead of undef Created July 10, 2017, 11:20 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | modules/discourse_docker/templates/app.yml.erb » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 # == Class: discourse_docker 1 # == Class: discourse_docker
2 # 2 #
3 # Depends on module docker (for now) 3 # Depends on module docker (for now)
4 # 4 #
5 # == Parameters: 5 # == Parameters:
6 6
7 # [*domain*] 7 # [*domain*]
8 # Set the domain (hostname) for the site. This will be used in both nginx and d iscourse settings. 8 # Set the domain (hostname) for the site. This will be used in both nginx and d iscourse settings.
9 # 9 #
10 # [*certificate*] 10 # [*certificate*]
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 # } 45 # }
46 # } 46 # }
47 # 47 #
48 class discourse_docker( 48 class discourse_docker(
49 $domain, 49 $domain,
50 $certificate = hiera('discourse_docker::certificate', undef), 50 $certificate = hiera('discourse_docker::certificate', undef),
51 $private_key = hiera('discourse_docker::private_key', undef), 51 $private_key = hiera('discourse_docker::private_key', undef),
52 $site_settings = hiera('discourse_docker::site_settings', {}), 52 $site_settings = hiera('discourse_docker::site_settings', {}),
53 $is_default = hiera('discourse_docker::is_default', false), 53 $is_default = hiera('discourse_docker::is_default', false),
54 $admins = hiera('discourse_docker::admins', []), 54 $admins = hiera('discourse_docker::admins', []),
55 $smtp_host = hiera('discourse_docker::smtp_host', undef), 55 $smtp_host = hiera('discourse_docker::smtp_host', '172.17.0.1'),
mathias 2017/07/07 19:45:43 Since the template does not place any conditional
f.nicolaisen 2017/07/10 08:29:08 We could use 172.17.0.1 as configured in the hiera
mathias 2017/07/10 08:32:42 Why not use the formerly hard-coded DISCOURSE_SMTP
f.nicolaisen 2017/07/10 08:39:44 There is no smtp service on localhost. The contain
56 $google_oauth2_client_id = hiera('discourse_docker::google_oauth2_client_id', 'undef'), 56 $google_oauth2_client_id = hiera('discourse_docker::google_oauth2_client_id', 'undef'),
57 $google_oauth2_client_secret = hiera('discourse_docker::google_oauth2_client_s ecret', 'undef'), 57 $google_oauth2_client_secret = hiera('discourse_docker::google_oauth2_client_s ecret', 'undef'),
58 ) { 58 ) {
59 59
60 include stdlib 60 include stdlib
61 61
62 package {'git': 62 package {'git':
63 ensure => present, 63 ensure => present,
64 } 64 }
65 65
66 file {'/var/discourse': 66 file {'/var/discourse':
67 ensure => directory, 67 ensure => directory,
68 mode => 755, 68 mode => '755',
69 owner => root, 69 owner => root,
70 group => root 70 group => root
71 } 71 }
72 72
73 exec {'fetch-discourse-docker': 73 exec {'fetch-discourse-docker':
74 command => "git clone https://github.com/discourse/discourse_docker.git /var /discourse", 74 command => "git clone https://github.com/discourse/discourse_docker.git /var /discourse",
75 path => ["/usr/bin/", "/bin/"], 75 path => ["/usr/bin/", "/bin/"],
76 user => root, 76 user => root,
77 timeout => 0, 77 timeout => 0,
78 require => [Package['git'], File['/var/discourse']], 78 require => [Package['git'], File['/var/discourse']],
79 unless => "test -d /var/discourse/.git" 79 unless => "test -d /var/discourse/.git"
80 } 80 }
81 81
82 file {'/var/discourse/containers/app.yml': 82 file {'/var/discourse/containers/app.yml':
83 ensure => file, 83 ensure => file,
84 mode => 600, 84 mode => '600',
85 owner => root, 85 owner => root,
86 group => root, 86 group => root,
87 content => template('discourse_docker/app.yml.erb'), 87 content => template('discourse_docker/app.yml.erb'),
88 require => Class['docker'], 88 require => Class['docker'],
89 } 89 }
90 90
91 exec {'rebuild': 91 exec {'rebuild':
92 command => '/var/discourse/launcher rebuild app --skip-prereqs', 92 command => '/var/discourse/launcher rebuild app --skip-prereqs',
93 user => root, 93 user => root,
94 subscribe => File['/var/discourse/containers/app.yml'], 94 subscribe => File['/var/discourse/containers/app.yml'],
(...skipping 14 matching lines...) Expand all
109 109
110 nginx::hostconfig {$domain: 110 nginx::hostconfig {$domain:
111 source => "puppet:///modules/discourse_docker/site.conf", 111 source => "puppet:///modules/discourse_docker/site.conf",
112 certificate => $certificate, 112 certificate => $certificate,
113 private_key => $private_key, 113 private_key => $private_key,
114 is_default => $is_default, 114 is_default => $is_default,
115 log => "access_log_intraforum" 115 log => "access_log_intraforum"
116 } 116 }
117 } 117 }
118 118
LEFTRIGHT

Powered by Google App Engine
This is Rietveld