danarchy_deploy 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.asdf_versions.json +5 -0
  3. data/.tool-versions +1 -0
  4. data/CHANGELOG.md +9 -0
  5. data/Gemfile.lock +9 -8
  6. data/danarchy_deploy.gemspec +4 -4
  7. data/lib/danarchy_deploy/groups.rb +0 -1
  8. data/lib/danarchy_deploy/services/init/openrc.rb +10 -6
  9. data/lib/danarchy_deploy/services/init.rb +28 -18
  10. data/lib/danarchy_deploy/services.rb +0 -1
  11. data/lib/danarchy_deploy/system/centos.rb +7 -0
  12. data/lib/danarchy_deploy/system/debian.rb +6 -0
  13. data/lib/danarchy_deploy/system/gentoo.rb +83 -23
  14. data/lib/danarchy_deploy/system/opensuse.rb +6 -0
  15. data/lib/danarchy_deploy/system.rb +13 -8
  16. data/lib/danarchy_deploy/templater.rb +1 -2
  17. data/lib/danarchy_deploy/users.rb +50 -42
  18. data/lib/danarchy_deploy/version.rb +1 -1
  19. data/lib/danarchy_deploy.rb +61 -19
  20. data/templates/applications/nginx/domain.conf.erb +38 -0
  21. data/templates/applications/php/phpfpm.conf.erb +19 -0
  22. data/templates/applications/php/user.conf.erb +19 -0
  23. data/templates/applications/wordpress/mysql_user_privileges.sql.erb +2 -0
  24. data/templates/applications/wordpress/wp-config.php.erb +82 -0
  25. data/templates/asdf/asdf.sh.erb +52 -0
  26. data/templates/deploy_template.json +6 -7
  27. data/templates/distcc/distccd.erb +14 -0
  28. data/templates/distcc/hosts.erb +2 -0
  29. data/templates/portage/make.conf.erb +30 -0
  30. data/templates/portage/package.use/bindist +3 -0
  31. data/templates/portage/package.use/documentation +3 -0
  32. data/templates/services/memcached/memcached.erb +40 -0
  33. data/templates/services/mysql/my.cnf.erb +143 -0
  34. data/templates/services/mysql/root_my.cnf.erb +11 -0
  35. data/templates/services/mysql/user_db_grants.sql.erb +33 -0
  36. data/templates/services/mysql/user_db_grants.sql.erb_cleanupUsers +52 -0
  37. data/templates/services/nginx/nginx.conf.erb +48 -0
  38. data/templates/services/php/php-fpm.conf.erb +2 -0
  39. data/templates/services/postfix/localmail.initial_setup.sh +19 -0
  40. data/templates/services/postfix/localmail.main.cf.erb +41 -0
  41. data/templates/services/postfix/mailname.erb +1 -0
  42. data/templates/services/postfix/mailrelayhost_main.cf.erb +33 -0
  43. data/templates/services/postfix/main.cf.erb +28 -0
  44. data/templates/services/postfix/master.cf.erb +124 -0
  45. data/templates/services/postfix/mysql-virtual-alias-maps.cf.erb +5 -0
  46. data/templates/services/postfix/mysql-virtual-mailbox-domains.cf.erb +5 -0
  47. data/templates/services/postfix/mysql-virtual-mailbox-maps.cf.erb +5 -0
  48. data/templates/system/authorized_keys.erb +5 -0
  49. data/templates/system/crontab.erb +8 -0
  50. data/templates/system/dmcrypt.erb +17 -0
  51. data/templates/system/exports.erb +4 -0
  52. data/templates/system/fstab.erb +4 -0
  53. data/templates/system/sudoers.erb +5 -0
  54. metadata +44 -11
  55. data/.ruby-gemset +0 -1
  56. data/.ruby-version +0 -1
  57. /data/bin/{setup → setup-dd} +0 -0
@@ -43,13 +43,15 @@ module DanarchyDeploy
43
43
  def self.new(deployment, options)
44
44
  puts "\n" + self.name
45
45
 
46
- options[:working_dir] = options[:deploy_dir] + '/' + deployment[:hostname]
46
+ @working_dir = File.dirname(options[:deploy_file]) + '/'
47
47
  connector = { hostname: deployment[:hostname],
48
48
  ipv4: deployment[:ipv4],
49
49
  ssh_user: deployment[:ssh_user],
50
50
  ssh_key: deployment[:ssh_key] }
51
51
 
52
+ pretend = options[:pretend] ; options[:pretend] = false
52
53
  remote_mkdir(connector, options)
54
+ # asdf_install(connector, options)
53
55
 
54
56
  if options[:dev_gem]
55
57
  puts "\nDev Gem mode: Building and pushing gem..."
@@ -63,6 +65,8 @@ module DanarchyDeploy
63
65
  gem_binary = _locate_gem_binary(connector, options) # this should run before any install; check version too
64
66
  push_templates(connector, options)
65
67
  push_deployment(connector, options)
68
+
69
+ options[:pretend] = pretend
66
70
  deploy_result = remote_LocalDeploy(connector, gem_binary, options)
67
71
 
68
72
  abort("\n ! Deployment failed to complete!") if !deploy_result
@@ -71,15 +75,15 @@ module DanarchyDeploy
71
75
  # remote_cleanup(connector, options) if !options[:pretend]
72
76
 
73
77
  puts "\nRemote deployment complete!"
74
- deployment = JSON.parse(File.read(options[:deploy_file]), symbolize_names: true) if options[:deploy_file].end_with?('.json')
75
- deployment = YAML.load_file(options[:deploy_file]) if options[:deploy_file].end_with?('.yaml')
76
- deployment
78
+ options[:deploy_file].end_with?('.json') ?
79
+ JSON.parse(File.read(options[:deploy_file]), symbolize_names: true) :
80
+ YAML.load_file(options[:deploy_file]) if options[:deploy_file].end_with?('.yaml')
77
81
  end
78
82
 
79
83
  private
80
84
  def self.remote_mkdir(connector, options)
81
- puts "\n > Creating directory: #{options[:working_dir]}"
82
- mkdir_cmd = _ssh_command(connector, "test -d #{options[:working_dir]} && echo 'Directory exists!' || sudo mkdir -vp #{options[:working_dir]}")
85
+ puts "\n > Creating directory: #{@working_dir}"
86
+ mkdir_cmd = _ssh_command(connector, "test -d #{@working_dir} && echo 'Directory exists!' || sudo mkdir -vp #{@working_dir}")
83
87
  mkdir_result = DanarchyDeploy::Helpers.run_command(mkdir_cmd, options)
84
88
 
85
89
  if mkdir_result[:stderr] && ! mkdir_result[:stdout]
@@ -100,12 +104,48 @@ module DanarchyDeploy
100
104
  end
101
105
  end
102
106
 
107
+ # def self.asdf_install(connector, options)
108
+ # versions = JSON.parse(
109
+ # File.read(File.expand_path('../', __dir__) + '/.asdf_versions.json'),
110
+ # symbolize_names: true)
111
+
112
+ # template = {
113
+ # target: '/tmp/asdf.sh_' + Random.hex(6),
114
+ # source: 'builtin::asdf/asdf.sh.erb',
115
+ # variables: versions
116
+ # }
117
+
118
+ # DanarchyDeploy::Templater.new([template], options)
119
+ # push_cmd = _scp_push(connector, template[:target], '/tmp')
120
+ # push_result = DanarchyDeploy::Helpers.run_command(push_cmd, options)
121
+
122
+ # if push_result[:stderr]
123
+ # abort(' ! Asdf push failed!')
124
+ # else
125
+ # puts ' |+ Asdf pushed!'
126
+ # asdf_chown_cmd = _ssh_command(
127
+ # connector,
128
+ # "sudo mv -v #{template[:target]} /etc/profile.d/asdf.sh && " +
129
+ # 'sudo chown -c root:root /etc/profile.d/asdf.sh')
130
+ # asdf_chown_result = DanarchyDeploy::Helpers.run_command(asdf_chown_cmd, options)
131
+ # File.delete(template[:target])
132
+ # end
133
+
134
+ # asdf_current_cmd = _ssh_command(connector, 'sudo -i asdf current')
135
+ # asdf_current_result = DanarchyDeploy::Helpers.run_command(asdf_current_cmd, options)
136
+
137
+ # puts asdf_current_result[:stderr] if asdf_current_result[:stderr]
138
+ # puts asdf_current_result[:stdout]
139
+ # end
140
+
103
141
  def self.gem_install(connector, options)
104
142
  puts "\n > Installing danarchy_deploy on #{connector[:hostname]}"
105
- install_cmd = _ssh_command(connector, 'sudo gem install -f danarchy_deploy')
143
+ install_cmd = _ssh_command(connector, 'sudo -i gem install -f danarchy_deploy')
106
144
  install_result = DanarchyDeploy::Helpers.run_command(install_cmd, options)
107
145
 
108
- if install_result[:stderr]
146
+ if install_result[:stderr] =~ /WARN/i
147
+ puts ' ! ' + install_result[:stderr]
148
+ elsif install_result[:stderr]
109
149
  abort(' ! Gem install failed!')
110
150
  else
111
151
  puts " |+ Gem installed!"
@@ -134,7 +174,7 @@ module DanarchyDeploy
134
174
 
135
175
  def self.dev_gem_install(connector, gem, options)
136
176
  puts "\n > Pushing gem: #{gem} to #{connector[:hostname]}"
137
- push_cmd = _scp_push(connector, gem, options[:deploy_dir])
177
+ push_cmd = _scp_push(connector, gem, options[:deploy_dir])
138
178
  push_result = DanarchyDeploy::Helpers.run_command(push_cmd, options)
139
179
 
140
180
  if push_result[:stderr]
@@ -144,10 +184,12 @@ module DanarchyDeploy
144
184
  end
145
185
 
146
186
  puts "\n > Installing gem: #{gem} on #{connector[:hostname]}"
147
- install_cmd = _ssh_command(connector, "sudo gem install --bindir /usr/local/bin -f #{options[:deploy_dir]}/#{File.basename(gem)}")
187
+ install_cmd = _ssh_command(connector, "sudo -i gem install --bindir /usr/local/bin -f #{options[:deploy_dir]}/#{File.basename(gem)}")
148
188
  install_result = DanarchyDeploy::Helpers.run_command(install_cmd, options)
149
189
 
150
- if install_result[:stderr]
190
+ if install_result[:stderr] =~ /WARN/i
191
+ puts ' ! ' + install_result[:stderr]
192
+ elsif install_result[:stderr]
151
193
  abort(' ! Gem install failed!')
152
194
  else
153
195
  puts ' |+ Gem installed!'
@@ -155,39 +197,39 @@ module DanarchyDeploy
155
197
  end
156
198
 
157
199
  def self.gem_clean(connector, options)
158
- clean_cmd = _ssh_command(connector, 'sudo gem clean danarchy_deploy 2&>/dev/null')
200
+ clean_cmd = _ssh_command(connector, 'sudo -i gem clean danarchy_deploy 2&>/dev/null')
159
201
  system(clean_cmd)
160
202
  end
161
203
 
162
204
  def self.push_templates(connector, options)
163
205
  template_dir = options[:deploy_dir] + '/templates'
164
206
  puts "\n > Pushing templates: #{template_dir}"
165
- push_cmd = _rsync_push(connector, template_dir, template_dir)
207
+ push_cmd = _rsync_push(connector, template_dir, template_dir)
166
208
  push_result = DanarchyDeploy::Helpers.run_command(push_cmd, options)
167
209
 
168
210
  if push_result[:stderr]
169
211
  abort(' ! Templates push failed!')
170
212
  else
171
- puts " |+ Templates pushed to '#{options[:working_dir]}'!"
213
+ puts " |+ Templates pushed to '#{template_dir}'!"
172
214
  end
173
215
  end
174
216
 
175
217
  def self.push_deployment(connector, options)
176
218
  puts "\n > Pushing deployment: #{options[:deploy_file]}"
177
- push_cmd = _rsync_push(connector, options[:working_dir], options[:working_dir])
219
+ push_cmd = _rsync_push(connector, @working_dir, @working_dir)
178
220
  push_result = DanarchyDeploy::Helpers.run_command(push_cmd, options)
179
221
 
180
222
  if push_result[:stderr]
181
223
  abort(' ! Deployment push failed!')
182
224
  else
183
- puts " |+ Deployment pushed to '#{options[:working_dir]}'!"
225
+ puts " |+ Deployment pushed to '#{@working_dir}'!"
184
226
  end
185
227
  end
186
228
 
187
229
  def self.remote_LocalDeploy(connector, gem_binary, options)
188
230
  puts "\n > Running LocalDeploy on #{connector[:hostname]}.\n\n"
189
231
 
190
- deploy_cmd = "sudo #{gem_binary} local "
232
+ deploy_cmd = "sudo -i #{gem_binary} local "
191
233
  deploy_cmd += '--first-run ' if options[:first_run]
192
234
  deploy_cmd += '--ssh-verbose ' if options[:ssh_verbose]
193
235
  deploy_cmd += '--vars-verbose ' if options[:vars_verbose]
@@ -214,7 +256,7 @@ module DanarchyDeploy
214
256
 
215
257
  def self.remote_cleanup(connector, options)
216
258
  puts "\n > Cleaning up: #{options[:deploy_dir]}"
217
- cleanup_cmd = _ssh_command(connector, "sudo rm -rfv #{options[:working_dir]}")
259
+ cleanup_cmd = _ssh_command(connector, "sudo rm -rfv #{@working_dir}")
218
260
  cleanup_result = DanarchyDeploy::Helpers.run_command(cleanup_cmd, options)
219
261
 
220
262
  if cleanup_result[:stderr]
@@ -225,7 +267,7 @@ module DanarchyDeploy
225
267
  end
226
268
 
227
269
  def self._locate_gem_binary(connector, options)
228
- locate_cmd = _ssh_command(connector, 'sudo which danarchy_deploy')
270
+ locate_cmd = _ssh_command(connector, 'sudo -i which danarchy_deploy')
229
271
  locate_result = DanarchyDeploy::Helpers.run_command(locate_cmd, options)
230
272
 
231
273
  if locate_result[:stderr]
@@ -0,0 +1,38 @@
1
+ server {
2
+ server_name www.<%= @variables[:domain] %>;
3
+ listen 80;
4
+ return 301 http://<%= @variables[:domain] %>/$request_uri;
5
+ }
6
+
7
+ server {
8
+ server_name <%= @variables[:domain] %>;
9
+ listen 80;
10
+
11
+ server_tokens off;
12
+ add_header X-Content-Type-Options nosniff;
13
+ add_header X-XSS-Protection "1; mode=block";
14
+ add_header X-Frame-Options "SAMEORIGIN";
15
+
16
+ access_log /home/<%= @variables[:username] %>/nginx/logs/<%= @variables[:domain] %>/access_log main;
17
+ error_log /home/<%= @variables[:username] %>/nginx/logs/<%= @variables[:domain] %>/error_log info;
18
+
19
+ root /home/<%= @variables[:username] %>/<%= @variables[:domain] %>;
20
+ index index.php;
21
+
22
+ location / {
23
+ try_files $uri $uri/ /index.php?q=$uri&$args;
24
+
25
+ }
26
+
27
+ location ~ \.php$ {
28
+ try_files $uri =404;
29
+ include /etc/nginx/fastcgi_params;
30
+ fastcgi_buffers 16 16k;
31
+ fastcgi_buffer_size 32k;
32
+ fastcgi_split_path_info ^(.+\.php)(/.+)$;
33
+ fastcgi_pass unix:/var/run/php-fpm-<%= @variables[:domain].gsub('.','_') %>.sock;
34
+ fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
35
+ fastcgi_index index.php;
36
+
37
+ }
38
+ }
@@ -0,0 +1,19 @@
1
+ [<%= @variables[:pool] %>]
2
+ user = <%= @variables[:username] %>
3
+ group = <%= @variables[:username] %>
4
+
5
+ listen = /var/run/php-fpm-<%= @variables[:pool] %>.sock
6
+ <% if @variables[:web_user] %>
7
+ listen.owner = <%= @variables[:web_user] %>
8
+ listen.group = <%= @variables[:web_user] %>
9
+ <% end %>
10
+ pm = dynamic
11
+ pm.max_children = 4
12
+ pm.start_servers = 1
13
+ pm.min_spare_servers = 1
14
+ pm.max_spare_servers = 2
15
+
16
+ env[TMP] = <%= @variables[:tmp] %>
17
+ env[TMPDIR] = <%= @variables[:tmp] %>
18
+ env[TEMP] = <%= @variables[:tmp] %>
19
+ env[PATH] = /usr/local/bin:/usr/bin:/bin
@@ -0,0 +1,19 @@
1
+ [<%= @variables[:username] %>]
2
+ user = <%= @variables[:username] %>
3
+ group = <%= @variables[:username] %>
4
+
5
+ listen = /var/run/php7-fpm-<%= @variables[:username] %>.sock
6
+ <% if @variables[:web_user] %>
7
+ listen.owner = <%= @variables[:web_user] %>
8
+ listen.group = <%= @variables[:web_user] %>
9
+ <% end %>
10
+ pm = dynamic
11
+ pm.max_children = 4
12
+ pm.start_servers = 1
13
+ pm.min_spare_servers = 1
14
+ pm.max_spare_servers = 2
15
+
16
+ env[TMP] = <%= @variables[:tmp] %>
17
+ env[TMPDIR] = <%= @variables[:tmp] %>
18
+ env[TEMP] = <%= @variables[:tmp] %>
19
+ env[PATH] = /usr/local/bin:/usr/bin:/bin
@@ -0,0 +1,2 @@
1
+ GRANT ALL PRIVILEGES ON `<%= @variables[:db_name] %>`.`*` TO `<%= @variables[:db_user] %>`@`<%= @variables[:db_host] %>` IDENTIFIED BY `<%= @variables[:db_pass] %>`;
2
+ FLUSH PRIVILEGES;
@@ -0,0 +1,82 @@
1
+ <?php
2
+ /**
3
+ * The base configuration for WordPress
4
+ *
5
+ * The wp-config.php creation script uses this file during the
6
+ * installation. You don't have to use the web site, you can
7
+ * copy this file to "wp-config.php" and fill in the values.
8
+ *
9
+ * This file contains the following configurations:
10
+ *
11
+ * * MySQL settings
12
+ * * Secret keys
13
+ * * Database table prefix
14
+ * * ABSPATH
15
+ *
16
+ * @link https://codex.wordpress.org/Editing_wp-config.php
17
+ *
18
+ * @package WordPress
19
+ */
20
+
21
+ // ** MySQL settings - You can get this info from your web host ** //
22
+ /** The name of the database for WordPress */
23
+ define('DB_NAME', '<%= @variables[:db_name] %>');
24
+
25
+ /** MySQL database username */
26
+ define('DB_USER', '<%= @variables[:db_user] %>');
27
+
28
+ /** MySQL database password */
29
+ define('DB_PASSWORD', '<%= DanarchyDeploy::Helpers.decode_base64(@variables[:db_pass]) %>');
30
+
31
+ /** MySQL hostname */
32
+ define('DB_HOST', '<%= @variables[:db_host] %>');
33
+
34
+ /** Database Charset to use in creating database tables. */
35
+ define('DB_CHARSET', 'utf8');
36
+
37
+ /** The Database Collate type. Don't change this if in doubt. */
38
+ define('DB_COLLATE', '');
39
+
40
+ /**#@+
41
+ * Authentication Unique Keys and Salts.
42
+ *
43
+ * Change these to different unique phrases!
44
+ * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
45
+ * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
46
+ *
47
+ * @since 2.6.0
48
+ */
49
+ <%= @variables[:salts] %>
50
+
51
+ /**#@-*/
52
+
53
+ /**
54
+ * WordPress Database Table prefix.
55
+ *
56
+ * You can have multiple installations in one database if you give each
57
+ * a unique prefix. Only numbers, letters, and underscores please!
58
+ */
59
+ $table_prefix = '<%= @variables[:table_prefix] ? @variables[:table_prefix] : "wp_" %>';
60
+
61
+ /**
62
+ * For developers: WordPress debugging mode.
63
+ *
64
+ * Change this to true to enable the display of notices during development.
65
+ * It is strongly recommended that plugin and theme developers use WP_DEBUG
66
+ * in their development environments.
67
+ *
68
+ * For information on other constants that can be used for debugging,
69
+ * visit the Codex.
70
+ *
71
+ * @link https://codex.wordpress.org/Debugging_in_WordPress
72
+ */
73
+ define('WP_DEBUG', false);
74
+
75
+ /* That's all, stop editing! Happy blogging. */
76
+
77
+ /** Absolute path to the WordPress directory. */
78
+ if ( !defined('ABSPATH') )
79
+ define('ABSPATH', dirname(__FILE__) . '/');
80
+
81
+ /** Sets up WordPress vars and included files. */
82
+ require_once(ABSPATH . 'wp-settings.php');
@@ -0,0 +1,52 @@
1
+ #!/bin/bash
2
+ # Deployed by danarchy_deploy
3
+ # manages system-wide asdf; still allows for local ~/.asdf
4
+
5
+ function _run_now() {
6
+ tmp_file=/tmp/asdf_next_run.tmp
7
+ next_run=$(cat ${tmp_file} 2>/dev/null || echo 0)
8
+
9
+ if [[ $(date '+%s') -gt ${next_run} ]]; then
10
+ echo 'true'
11
+ else
12
+ echo 'false'
13
+ fi
14
+ }
15
+
16
+ function _load_asdf() {
17
+ path=${1}
18
+ export ASDF_DATA_DIR=${path}
19
+ source ${path}/asdf.sh
20
+ source ${path}/completions/asdf.bash
21
+ }
22
+
23
+ if [[ ${UID} == 0 && $(_run_now) == 'true' ]]; then
24
+ if [[ ! -d /opt/asdf ]]; then
25
+ git clone https://github.com/asdf-vm/asdf.git /opt/asdf
26
+ fi
27
+
28
+ asdf update >/dev/null 2>&1
29
+ _load_asdf /opt/asdf
30
+
31
+ <%- @variables.each do |lang, versions| -%>
32
+ asdf plugin add <%= lang -%>
33
+
34
+ <%- versions.each do |version| -%>
35
+ asdf install <%= lang -%> <%= version -%>
36
+ <% end %>
37
+
38
+ asdf global <%= lang %> <%= versions.first -%>
39
+ <% end %>
40
+
41
+ date -d '1 hour' '+%s' > /tmp/asdf_next_run.tmp
42
+ asdf current
43
+ fi
44
+
45
+ if [[ -d ${HOME}/.asdf ]]; then
46
+ _load_asdf ${HOME}/.asdf
47
+ elif [[ -d /opt/asdf ]]; then
48
+ _load_asdf /opt/asdf
49
+ fi
50
+
51
+ unset -f _run_now
52
+ unset -f _load_asdf
@@ -9,7 +9,7 @@
9
9
  "package2"
10
10
  ],
11
11
  "system": {
12
- "update": "all || system || packages || none",
12
+ "update": "true || all || system || selected || none || false",
13
13
  "fstab": {
14
14
  "source": "builtin::system/fstab_gentoo_client.erb",
15
15
  "mounts": [
@@ -36,14 +36,13 @@
36
36
  }
37
37
  ]
38
38
  },
39
- "users": [
40
- {
41
- "username": "username",
39
+ "users": {
40
+ "username": {
42
41
  "home": "/home/username",
43
42
  "uid": int,
44
43
  "gid": int,
45
- "sudoer": "username ALL = NOPASSWD: ALL",
46
- "ssh-authorized_keys": [
44
+ "sudoer": ["username ALL=(ALL) NOPASSWD:ALL"],
45
+ "authorized_keys": [
47
46
  "ssh-ed25519 it0C5o6GHC8lxqctpexakfdA5o7LeSe+QbMhIl+GYtZ2OCMFliLsODDrrazR+u2y user@hostname",
48
47
  "ssh-rsa K0APeEvotGunpBrl/LvSAG/gLUldCnOrL60v47QYjuqoGJmM3Fk8V29+8jZPp9Dl user@hostname"
49
48
  ],
@@ -61,7 +60,7 @@
61
60
  }
62
61
  ]
63
62
  }
64
- ],
63
+ },
65
64
  "groups": [
66
65
  {
67
66
  "groupname": "groupname",
@@ -0,0 +1,14 @@
1
+ # Deployed by dAnarchy_deploy: /etc/conf.d/distccd: config file for /etc/init.d/distccd
2
+
3
+ # this is the distccd executable
4
+ DISTCCD_EXEC="/usr/bin/distccd"
5
+
6
+ # this is where distccd will store its pid file
7
+ DISTCCD_PIDFILE="/var/run/distccd/distccd.pid"
8
+
9
+ <%= @variables[:opts] ? 'DISTCCD_OPTS=' + "\"#{@variables[:opts]}\"" : 'DISTCCD_OPTS=""' %>
10
+ <%= @variables[:port] ? 'DISTCCD_OPTS=' + "\"${DISTCCD_OPTS} --port #{@variables[:port]}\"" : 'DISTCCD_OPTS="${DISTCCD_OPTS} --port 3632"' %>
11
+ <%= @variables[:loglevel] ? 'DISTCCD_OPTS=' + "\"${DISTCCD_OPTS} --log-level #{@variables[:loglevel]}\"" : 'DISTCCD_OPTS="${DISTCCD_OPTS} --log-level critical"' %>
12
+ <%= @variables[:allow] ? 'DISTCCD_OPTS=' + "\"${DISTCCD_OPTS} --allow #{@variables[:allow]}\"" : '' %>
13
+ <%= @variables[:listen] ? 'DISTCCD_OPTS=' + "\"${DISTCCD_OPTS} --listen #{@variables[:listen]}\"" : '' %>
14
+ <%= @variables[:nice] ? 'DISTCCD_OPTS=' + "\"${DISTCCD_OPTS} -N #{@variables[:nice]}\"" : '' %>
@@ -0,0 +1,2 @@
1
+ # Deployed by dAnarchy_deploy: /etc/distcc/hosts
2
+ <%= @variables[:hosts] ? "#{@variables[:hosts]}" : 'localhost' -%>
@@ -0,0 +1,30 @@
1
+ # Deployed by dAnarchy_deploy: /etc/portage/make.conf
2
+ COMMON_FLAGS="-march=<%= `gcc -march=native -Q --help=target | grep march`.split[1] %> -O2 -pipe"
3
+ CFLAGS="${COMMON_FLAGS}"
4
+ CXXFLAGS="${COMMON_FLAGS}"
5
+ FCFLAGS="${COMMON_FLAGS}"
6
+ FFLAGS="${COMMON_FLAGS}"
7
+
8
+ MAKEOPTS="-j<%= `nproc`.to_i * 2 + 1 %> -l<%= `nproc`.to_i %>"
9
+ CPU_FLAGS_X86="<%= `cpuid2cpuflags`.split(': ').last.chomp %>"
10
+
11
+ <% if !@variables -%>
12
+ USE="bindist logrotate"
13
+ INPUT_DEVICES="evdev keyboard"
14
+ <% else -%>
15
+ <%= @variables[:use] ? 'USE=' + "\"bindist logrotate #{@variables[:use]}\"\n" : "USE=\"bindist logrotate\"\n" -%>
16
+ <%= @variables[:grub] ? 'GRUB_PLATFORMS=' + "\"#{@variables[:grub]}\"\n" : '' -%>
17
+ <%= @variables[:ruby] ? 'RUBY_TARGETS=' + "\"#{@variables[:ruby]}\"\n" : '' -%>
18
+ <%= @variables[:php] ? 'PHP_TARGETS=' + "\"#{@variables[:php]}\"\n" : '' -%>
19
+ <%= @variables[:features] ? 'FEATURES=' + "\"#{@variables[:features]}\"\n" : '' -%>
20
+ <%= @variables[:videocards] ? 'VIDEO_CARDS=' + "\"#{@variables[:videocards]}\"\n" : '' -%>
21
+ <%= @variables[:input] ? 'INPUT_DEVICES=' + "\"#{@variables[:input]}\"\n" : "INPUT_DEVICES=\"evdev keyboard\"\n" -%>
22
+ <% end -%>
23
+
24
+ # This sets the language of build output to English.
25
+ # Please keep this setting intact when reporting bugs.
26
+ LC_MESSAGES=C
27
+
28
+ PORTDIR="/var/db/repos/gentoo"
29
+ DISTDIR="/var/cache/distfiles"
30
+ PKGDIR="/var/cache/binpkgs"
@@ -0,0 +1,3 @@
1
+ # Allow EC algorithms in OpenSSL/OpenSSH (patents blocked with bindist)
2
+ dev-libs/openssl -bindist
3
+ net-misc/openssh -bindist
@@ -0,0 +1,3 @@
1
+ dev-lang/perl doc
2
+ dev-lang/python doc
3
+ dev-lang/ruby doc
@@ -0,0 +1,40 @@
1
+ # memcached config file
2
+
3
+ MEMCACHED_BINARY="/usr/bin/memcached"
4
+
5
+ # Specify memory usage in megabytes (do not use letters)
6
+ # 64MB is default
7
+ MEMUSAGE="64"
8
+
9
+ # User to run as
10
+ MEMCACHED_RUNAS="memcached"
11
+
12
+ # Specify maximum number of concurrent connections
13
+ # 1024 is default
14
+ MAXCONN="1024"
15
+
16
+ # Listen for connections on what address?
17
+ # If this is empty, memcached will listen on 0.0.0.0
18
+ # be sure you have a firewall in place!
19
+ LISTENON="<%= (@variables && @variables[:listenon]) ? @variables[:listenon] : '127.0.0.1' %>"
20
+
21
+ # Listen for connections on what port?
22
+ PORT="<%= (@variables && @variables[:port]) ? @variables[:port] : '11211' %>"
23
+
24
+ # Listen for UDP connecitons on what port? 0 means turn off UDP
25
+ UDPPORT="${PORT}"
26
+
27
+ # PID file location
28
+ # '-${PORT}.${CONF}.pid' will be appended to this!
29
+ # You do not normally need to change this.
30
+ PIDBASE="/var/run/memcached/memcached"
31
+
32
+ # Socket to listen on
33
+ #SOCKET="/var/run/memcached/memcached.sock"
34
+
35
+ # Socket mask
36
+ # 0700 is default
37
+ #SOCKET_MASK="0700"
38
+
39
+ # Other Options
40
+ MISC_OPTS=""