|
2 | 2 | String $config_source, |
3 | 3 | String $admin_permissions_source, |
4 | 4 | String $client_permissions_source, |
5 | | - String $api_keys_matched_to_client_ids_source, |
6 | 5 | String $movie_fetcher_config_source, |
7 | 6 | String $completeness_source, |
8 | 7 | String $externalid_mapping_organizer_source, |
9 | 8 | String $externalid_mapping_place_source, |
10 | 9 | String $pubkey_uitidv1_source, |
11 | 10 | String $pubkey_keycloak_source, |
12 | | - String $version = 'latest', |
13 | | - String $repository = 'uitdatabank-entry-api', |
14 | | - Enum['present', 'absent'] $amqp_listener_uitpas = 'present', |
15 | | - Enum['present', 'absent'] $bulk_label_offer_worker = 'present', |
16 | | - Enum['present', 'absent'] $mail_worker = 'present', |
17 | | - Integer[0] $event_export_worker_count = 1, |
18 | | - Optional[String] $puppetdb_url = lookup('data::puppet::puppetdb::url', Optional[String], 'first', undef) |
| 11 | + String $version = 'latest', |
| 12 | + String $repository = 'uitdatabank-entry-api', |
| 13 | + Optional[String] $api_keys_matched_to_client_ids_source = undef, |
| 14 | + Enum['present', 'absent'] $amqp_listener_uitpas = 'present', |
| 15 | + Enum['present', 'absent'] $bulk_label_offer_worker = 'present', |
| 16 | + Enum['present', 'absent'] $mail_worker = 'present', |
| 17 | + Integer[0] $event_export_worker_count = 1, |
| 18 | + Optional[String] $puppetdb_url = lookup('data::puppet::puppetdb::url', Optional[String], 'first', undef) |
19 | 19 | ) inherits ::profiles { |
20 | 20 |
|
21 | 21 | $basedir = '/var/www/udb3-backend' |
22 | 22 | $secrets = lookup('vault:uitdatabank/udb3-backend') |
23 | 23 | $mount_target_dns_name = lookup('terraform::efs::mount_target_dns_name', Optional[String], 'first', undef) |
24 | 24 | $file_default_attributes = { |
25 | | - ensure => 'file', |
26 | 25 | owner => 'www-data', |
27 | 26 | group => 'www-data', |
28 | 27 | require => [Group['www-data'], User['www-data'], Package['uitdatabank-entry-api']], |
|
50 | 49 | } |
51 | 50 |
|
52 | 51 | file { 'uitdatabank-entry-api-config': |
| 52 | + ensure => 'file', |
53 | 53 | path => "${basedir}/config.php", |
54 | 54 | content => template($config_source), |
55 | 55 | * => $file_default_attributes |
56 | 56 | } |
57 | 57 |
|
58 | 58 | file { 'uitdatabank-entry-api-admin-permissions': |
| 59 | + ensure => 'file', |
59 | 60 | path => "${basedir}/config.allow_all.php", |
60 | 61 | content => template($admin_permissions_source), |
61 | 62 | * => $file_default_attributes |
62 | 63 | } |
63 | 64 |
|
64 | 65 | file { 'uitdatabank-entry-api-client-permissions': |
| 66 | + ensure => 'file', |
65 | 67 | path => "${basedir}/config.client_permissions.php", |
66 | 68 | content => template($client_permissions_source), |
67 | 69 | * => $file_default_attributes |
68 | 70 | } |
69 | 71 |
|
70 | 72 | file { 'uitdatabank-entry-api-api-keys-matched-to-client-ids': |
| 73 | + ensure => $api_keys_matched_to_client_ids_source ? { |
| 74 | + undef => 'absent', |
| 75 | + default => 'file' |
| 76 | + }, |
71 | 77 | path => "${basedir}/config.api_keys_matched_to_client_ids.php", |
72 | | - content => template($api_keys_matched_to_client_ids_source), |
| 78 | + content => $api_keys_matched_to_client_ids_source ? { |
| 79 | + undef => undef, |
| 80 | + default => template($api_keys_matched_to_client_ids_source), |
| 81 | + }, |
73 | 82 | * => $file_default_attributes |
74 | 83 | } |
75 | 84 |
|
76 | 85 | file { 'uitdatabank-entry-api-movie-fetcher-config': |
| 86 | + ensure => 'file', |
77 | 87 | path => "${basedir}/config.kinepolis.php", |
78 | 88 | content => template($movie_fetcher_config_source), |
79 | 89 | * => $file_default_attributes |
80 | 90 | } |
81 | 91 |
|
82 | 92 | file { 'uitdatabank-entry-api-completeness': |
| 93 | + ensure => 'file', |
83 | 94 | path => "${basedir}/config.completeness.php", |
84 | 95 | content => template($completeness_source), |
85 | 96 | * => $file_default_attributes |
86 | 97 | } |
87 | 98 |
|
88 | 99 | file { 'uitdatabank-entry-api-externalid-mapping-organizer': |
| 100 | + ensure => 'file', |
89 | 101 | path => "${basedir}/config.external_id_mapping_organizer.php", |
90 | 102 | content => template($externalid_mapping_organizer_source), |
91 | 103 | * => $file_default_attributes |
92 | 104 | } |
93 | 105 |
|
94 | 106 | file { 'uitdatabank-entry-api-externalid-mapping-place': |
| 107 | + ensure => 'file', |
95 | 108 | path => "${basedir}/config.external_id_mapping_place.php", |
96 | 109 | content => template($externalid_mapping_place_source), |
97 | 110 | * => $file_default_attributes |
98 | 111 | } |
99 | 112 |
|
100 | 113 | file { 'uitdatabank-entry-api-pubkey-uitidv1': |
| 114 | + ensure => 'file', |
101 | 115 | path => "${basedir}/public.pem", |
102 | 116 | content => template($pubkey_uitidv1_source), |
103 | 117 | * => $file_default_attributes |
104 | 118 | } |
105 | 119 |
|
106 | 120 | file { 'uitdatabank-entry-api-pubkey-keycloak': |
| 121 | + ensure => 'file', |
107 | 122 | path => "${basedir}/public-keycloak.pem", |
108 | 123 | content => template($pubkey_keycloak_source), |
109 | 124 | * => $file_default_attributes |
|
0 commit comments