Procházet zdrojové kódy

Adopt osfinger subdirectory names for screen and ssh.
Add ssh client configuration.

Andrew Klopper před 8 roky
rodič
revize
66943112a2

base/screen/files/ubuntu/17.04/screenrc → base/screen/files/Ubuntu-17.04/screenrc


+ 1 - 1
base/screen/init.sls

@@ -7,6 +7,6 @@ screen:
7 7
 screenrc:
8 8
   file.managed:
9 9
     - name: {{ screen.screenrc_file }}
10
-    - source: salt://screen/files/{{ screen.screenrc_file_source }}
10
+    - source: salt://screen/files/{{ grains['osfinger'] }}/screenrc
11 11
     - require:
12 12
       - pkg: screen

+ 0 - 2
base/screen/map.jinja

@@ -2,11 +2,9 @@
2 2
 	'Debian': {
3 3
 		'package': 'screen',
4 4
 		'screenrc_file': '/etc/screenrc',
5
-		'screenrc_file_source': 'debian/%s/screenrc' % salt['grains.get']('osmajorrelease')
6 5
 	},
7 6
 	'Ubuntu': {
8 7
 		'package': 'screen',
9 8
 		'screenrc_file': '/etc/screenrc',
10
-		'screenrc_file_source': 'ubuntu/%s/screenrc' % salt['grains.get']('osrelease')
11 9
 	}
12 10
 }, grain='os', merge=salt['pillar.get']('screen:lookup')) %}

+ 56 - 0
base/ssh/files/Ubuntu-17.04/ssh_config

@@ -0,0 +1,56 @@
1
+
2
+# This is the ssh client system-wide configuration file.  See
3
+# ssh_config(5) for more information.  This file provides defaults for
4
+# users, and the values can be changed in per-user configuration files
5
+# or on the command line.
6
+
7
+# Configuration data is parsed as follows:
8
+#  1. command line options
9
+#  2. user-specific file
10
+#  3. system-wide file
11
+# Any configuration value is only changed the first time it is set.
12
+# Thus, host-specific definitions should be at the beginning of the
13
+# configuration file, and defaults at the end.
14
+
15
+# Site-wide defaults for some commonly used options.  For a comprehensive
16
+# list of available options, their meanings and defaults, please see the
17
+# ssh_config(5) man page.
18
+
19
+Host *
20
+#   ForwardAgent no
21
+#   ForwardX11 no
22
+#   ForwardX11Trusted yes
23
+#   RhostsRSAAuthentication no
24
+#   RSAAuthentication yes
25
+#   PasswordAuthentication yes
26
+#   HostbasedAuthentication no
27
+#   GSSAPIAuthentication no
28
+#   GSSAPIDelegateCredentials no
29
+#   GSSAPIKeyExchange no
30
+#   GSSAPITrustDNS no
31
+#   BatchMode no
32
+#   CheckHostIP yes
33
+#   AddressFamily any
34
+#   ConnectTimeout 0
35
+#   StrictHostKeyChecking ask
36
+#   IdentityFile ~/.ssh/identity
37
+#   IdentityFile ~/.ssh/id_rsa
38
+#   IdentityFile ~/.ssh/id_dsa
39
+#   IdentityFile ~/.ssh/id_ecdsa
40
+#   IdentityFile ~/.ssh/id_ed25519
41
+#   Port 22
42
+#   Protocol 2
43
+#   Cipher 3des
44
+#   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
45
+#   MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
46
+#   EscapeChar ~
47
+#   Tunnel no
48
+#   TunnelDevice any:any
49
+#   PermitLocalCommand no
50
+#   VisualHostKey no
51
+#   ProxyCommand ssh -q -W %h:%p gateway.example.com
52
+#   RekeyLimit 1G 1h
53
+    SendEnv LANG LC_*
54
+    HashKnownHosts yes
55
+    GSSAPIAuthentication yes
56
+    PubkeyAcceptedKeyTypes=+ssh-dss

+ 12 - 0
base/ssh/init.sls

@@ -0,0 +1,12 @@
1
+{% from 'ssh/map.jinja' import ssh %}
2
+
3
+ssh:
4
+  pkg.installed:
5
+    - name: {{ ssh.client_package }}
6
+
7
+ssh_config:
8
+  file.managed:
9
+    - name: {{ ssh.client_config_file }}
10
+    - source: salt://ssh/files/{{ grains['osfinger'] }}/ssh_config
11
+    - require:
12
+      - pkg: ssh

+ 4 - 2
base/ssh/map.jinja

@@ -1,14 +1,16 @@
1 1
 {% set ssh = salt['grains.filter_by']({
2 2
 	'Debian': {
3
+		'client_package': 'openssh-client',
4
+		'client_config_file': '/etc/ssh/ssh_config',
3 5
 		'server_package': 'openssh-server',
4 6
 		'server_service': 'ssh',
5 7
 		'server_config_file': '/etc/ssh/sshd_config',
6
-		'server_config_file_source': 'debian/%s/sshd_config' % salt['grains.get']('osmajorrelease')
7 8
 	},
8 9
 	'Ubuntu': {
10
+		'client_package': 'openssh-client',
9 11
 		'server_package': 'openssh-server',
10 12
 		'server_service': 'ssh',
11 13
 		'server_config_file': '/etc/ssh/sshd_config',
12
-		'server_config_file_source': 'ubuntu/%s/sshd_config' % salt['grains.get']('osrelease')
14
+		'client_config_file': '/etc/ssh/ssh_config',
13 15
 	},
14 16
 }, grain='os', merge=salt['pillar.get']('ssh:lookup')) %}

base/ssh/server/files/debian/7/sshd_config → base/ssh/server/files/Debian-7/sshd_config


base/ssh/server/files/debian/8/sshd_config → base/ssh/server/files/Debian-8/sshd_config


base/ssh/server/files/ubuntu/17.04/sshd_config → base/ssh/server/files/Ubuntu-17.04/sshd_config


+ 4 - 1
base/ssh/server/init.sls

@@ -1,5 +1,8 @@
1 1
 {% from 'ssh/map.jinja' import ssh %}
2 2
 
3
+include:
4
+  - ssh
5
+
3 6
 sshd:
4 7
   pkg.installed:
5 8
     - name: {{ ssh.server_package }}
@@ -12,6 +15,6 @@ sshd:
12 15
 sshd_config:
13 16
   file.managed:
14 17
     - name: {{ ssh.server_config_file }}
15
-    - source: salt://ssh/server/files/{{ ssh.server_config_file_source }}
18
+    - source: salt://ssh/server/files/{{ grains['osfinger'] }}/sshd_config
16 19
     - require:
17 20
       - pkg: sshd