machinery-tool 1.21.0 → 1.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/.git_revision +1 -1
  3. data/NEWS +8 -0
  4. data/html/index.html.haml +8 -7
  5. data/html/partials/changed_config_files.html.haml +1 -1
  6. data/html/partials/changed_managed_files.html.haml +1 -1
  7. data/html/partials/unmanaged_files.html.haml +2 -2
  8. data/lib/cli.rb +26 -4
  9. data/lib/diff_widget.rb +73 -0
  10. data/lib/dpkg_database.rb +16 -1
  11. data/lib/haml_helpers.rb +60 -0
  12. data/lib/kiwi_config.rb +7 -0
  13. data/lib/machinery.rb +3 -0
  14. data/lib/man_task.rb +3 -2
  15. data/lib/move_task.rb +1 -0
  16. data/lib/remote_system.rb +4 -0
  17. data/lib/server.rb +2 -105
  18. data/lib/static_html.rb +75 -0
  19. data/lib/system.rb +2 -1
  20. data/lib/system_description.rb +10 -0
  21. data/lib/version.rb +1 -1
  22. data/machinery-helper/version.go +1 -1
  23. data/man/generated/machinery.1.gz +0 -0
  24. data/manual/docs/README.md +8 -16
  25. data/manual/docs/docs.md +42 -4
  26. data/manual/docs/index.html +6 -2
  27. data/manual/docs/machinery-analyze.1.md +6 -10
  28. data/manual/docs/machinery-build.1.md +7 -11
  29. data/manual/docs/machinery-compare.1.md +5 -10
  30. data/manual/docs/machinery-config.1.md +4 -7
  31. data/manual/docs/machinery-copy.1.md +5 -10
  32. data/manual/docs/machinery-deploy.1.md +8 -12
  33. data/manual/docs/machinery-export-autoyast.1.md +10 -17
  34. data/manual/docs/machinery-export-html.1.md +32 -0
  35. data/manual/docs/machinery-export-kiwi.1.md +7 -12
  36. data/manual/docs/{machinery-inspect-docker.1.md → machinery-inspect-container.1.md} +10 -15
  37. data/manual/docs/machinery-inspect.1.md +10 -15
  38. data/manual/docs/machinery-list.1.md +4 -8
  39. data/manual/docs/machinery-man.1.md +4 -6
  40. data/manual/docs/machinery-move.1.md +4 -8
  41. data/manual/docs/machinery-remove.1.md +5 -10
  42. data/manual/docs/machinery-serve.1.md +5 -9
  43. data/manual/docs/machinery-show.1.md +7 -11
  44. data/manual/docs/machinery-upgrade-format.1.md +5 -9
  45. data/manual/docs/machinery-validate.1.md +4 -8
  46. data/manual/docs/machinery_main_general.1.md +33 -51
  47. data/manual/docs/machinery_main_scopes.1.md +13 -14
  48. data/manual/docs/{machinery_security_implications.1.md → machinery_main_security_implications.1.md} +15 -15
  49. data/manual/docs/machinery_main_usecases.1.md +2 -30
  50. data/manual/mkdocs.yml +9 -9
  51. data/manual/site/docs/index.html +71 -25
  52. data/manual/site/index.html +6 -2
  53. data/manual/site/machinery-analyze.1/index.html +34 -27
  54. data/manual/site/machinery-build.1/index.html +35 -28
  55. data/manual/site/machinery-compare.1/index.html +33 -26
  56. data/manual/site/machinery-config.1/index.html +32 -25
  57. data/manual/site/machinery-copy.1/index.html +33 -27
  58. data/manual/site/machinery-deploy.1/index.html +36 -29
  59. data/manual/site/machinery-export-autoyast.1/index.html +38 -32
  60. data/manual/site/machinery-export-html.1/index.html +175 -0
  61. data/manual/site/machinery-export-kiwi.1/index.html +35 -28
  62. data/manual/site/machinery-inspect-container.1/index.html +249 -0
  63. data/manual/site/machinery-inspect.1/index.html +38 -31
  64. data/manual/site/machinery-list.1/index.html +32 -25
  65. data/manual/site/machinery-man.1/index.html +32 -26
  66. data/manual/site/machinery-move.1/index.html +32 -25
  67. data/manual/site/machinery-remove.1/index.html +33 -26
  68. data/manual/site/machinery-serve.1/index.html +33 -26
  69. data/manual/site/machinery-show.1/index.html +35 -28
  70. data/manual/site/machinery-upgrade-format.1/index.html +33 -26
  71. data/manual/site/machinery-validate.1/index.html +32 -25
  72. data/manual/site/machinery_main_general.1/index.html +63 -70
  73. data/manual/site/machinery_main_scopes.1/index.html +41 -36
  74. data/manual/site/machinery_main_security_implications.1/index.html +228 -0
  75. data/manual/site/machinery_main_usecases.1/index.html +30 -48
  76. data/manual/site/mkdocs/search_index.json +246 -201
  77. data/manual/site/sitemap.xml +40 -30
  78. data/plugins/os/os_inspector.rb +1 -1
  79. data/plugins/packages/packages.yml +1 -1
  80. data/plugins/patterns/patterns.yml +2 -5
  81. data/plugins/repositories/repositories.yml +2 -2
  82. data/plugins/unmanaged_files/unmanaged_files.yml +3 -3
  83. data/plugins/unmanaged_files/unmanaged_files_renderer.rb +1 -1
  84. metadata +11 -5
  85. data/manual/docs/subcommand-template.1.md +0 -46
@@ -1,28 +1,24 @@
1
-
2
1
  # move — Move System Description
3
2
 
4
- ## SYNOPSIS
3
+ ## Synopsis
5
4
 
6
5
  `machinery move`
7
6
  FROM_NAME TO_NAME
8
7
 
9
8
  `machinery` help move
10
9
 
11
-
12
- ## DESCRIPTION
10
+ ## Description
13
11
 
14
12
  The `move` command renames a stored system description from `FROM_NAME` to `TO_NAME`.
15
13
 
16
-
17
- ## ARGUMENTS
14
+ ## Arguments
18
15
  * `FROM_NAME` (required):
19
16
  Current name of the system description.
20
17
 
21
18
  * `TO_NAME` (required):
22
19
  New name of the system description.
23
20
 
24
-
25
- ## EXAMPLES
21
+ ## Examples
26
22
 
27
23
  * Rename the system description `earth` to `moon`:
28
24
 
@@ -1,20 +1,17 @@
1
-
2
1
  # remove — Remove System Descriptions
3
2
 
4
- ## SYNOPSIS
3
+ ## Synopsis
5
4
 
6
5
  `machinery remove` [--all]
7
6
  [NAME[,NAME2[,NAME3]]]
8
7
 
9
8
  `machinery` help remove
10
9
 
11
-
12
- ## DESCRIPTION
10
+ ## Description
13
11
 
14
12
  The `remove` command removes all specified system descriptions.
15
13
 
16
-
17
- ## OPTIONS
14
+ ## Options
18
15
 
19
16
  * `--all` (optional):
20
17
  Remove all stored system descriptions.
@@ -22,14 +19,12 @@ The `remove` command removes all specified system descriptions.
22
19
  * `--verbose` (optional):
23
20
  Explain what is being done.
24
21
 
25
-
26
- ## ARGUMENTS
22
+ ## Arguments
27
23
 
28
24
  * `NAME...` (required):
29
25
  Remove specified system descriptions.
30
26
 
31
-
32
- ## EXAMPLES
27
+ ## Examples
33
28
 
34
29
  * Remove the system description stored as `earth`:
35
30
 
@@ -1,14 +1,12 @@
1
+ # serve — Serve System Descriptions Using a Web Server
1
2
 
2
- # serve — Serve System Descriptions Using A Web Server
3
-
4
- ## SYNOPSIS
3
+ ## Synopsis
5
4
 
6
5
  `machinery serve` [-p PORT | --port=PORT] [--public]
7
6
 
8
7
  `machinery` help serve
9
8
 
10
-
11
- ## DESCRIPTION
9
+ ## Description
12
10
 
13
11
  The `serve` command spawns a web server to view system descriptions as an HTML
14
12
  view.
@@ -20,8 +18,7 @@ Specific descriptions are available from http://127.0.0.1:7585/NAME, where NAME
20
18
  is the name of the system description. If no name is specified in the URL an
21
19
  overview of all descriptions is served.
22
20
 
23
-
24
- ## OPTIONS
21
+ ## Options
25
22
 
26
23
  * `-p PORT`, `--port=PORT` (optional):
27
24
  Specify the port on which the web server will serve the HTML view: Default: 7585
@@ -33,8 +30,7 @@ overview of all descriptions is served.
33
30
  Specifying this option, lets the server listen on each configured IP address. By default
34
31
  the server will only listen on the localhost IP address 127.0.0.1
35
32
 
36
-
37
- ## EXAMPLES
33
+ ## Examples
38
34
 
39
35
  * Start the server with default options:
40
36
 
@@ -1,38 +1,34 @@
1
-
2
1
  # show — Show System Description
3
2
 
4
- ## SYNOPSIS
3
+ ## Synopsis
5
4
 
6
5
  `machinery show` [-s SCOPE | --scope=SCOPE] [-e IGNORE-SCOPE | --ignore-scope=IGNORE-SCOPE] [--no-pager] [--show-diffs] [--html] NAME
7
6
 
8
7
  `machinery` help show
9
8
 
10
-
11
- ## DESCRIPTION
9
+ ## Description
12
10
 
13
11
  The `show` command displays a stored system description.
14
12
  Scopes are supported and limit the output to the given scope.
15
13
  The hostname of the inspected system and the last modification
16
14
  in local time are shown in the title of each scope section.
17
15
 
18
-
19
- ## ARGUMENTS
16
+ ## Arguments
20
17
 
21
18
  * `NAME` (required):
22
19
  Use specified system description.
23
20
 
24
-
25
- ## OPTIONS
21
+ ## Options
26
22
 
27
23
  * `-s SCOPE`, `--scope=SCOPE` (optional):
28
24
  Limit output to the specified scope.
29
- See the [Scope section](#Scopes) for more information.
25
+ See the [Scope section](machinery_main_scopes.1/) for more information.
30
26
  If displaying information related to a scope fails, `show` will print an error message what has failed.
31
27
  In case of an error, no content is displayed.
32
28
 
33
29
  * `-e IGNORE-SCOPE`, `--ignore-scope=IGNORE-SCOPE` (optional):
34
30
  Skip output of the specified scope.
35
- See the [Scope section](#Scopes) for more information.
31
+ See the [Scope section](machinery_main_scopes.1/) for more information.
36
32
 
37
33
  * `--no-pager` (optional):
38
34
  Do not pipe output into a pager.
@@ -48,7 +44,7 @@ in local time are shown in the title of each scope section.
48
44
  * `--verbose` (optional):
49
45
  Display the filters which were applied before showing the system description.
50
46
 
51
- ## EXAMPLES
47
+ ## Examples
52
48
 
53
49
  * Show the system description taken from the last inspection, saved as `earth`:
54
50
 
@@ -1,7 +1,6 @@
1
-
2
1
  # upgrade-format — Upgrade System Description
3
2
 
4
- ## SYNOPSIS
3
+ ## Synopsis
5
4
 
6
5
  `machinery upgrade-format` --all
7
6
 
@@ -9,8 +8,7 @@
9
8
 
10
9
  `machinery` help upgrade-format
11
10
 
12
-
13
- ## DESCRIPTION
11
+ ## Description
14
12
 
15
13
  The `upgrade-format` command upgrades a system description to the latest format
16
14
  version.
@@ -24,19 +22,17 @@ in the `meta` section of the according `manifest.json` file.
24
22
 
25
23
  If the `--all` switch is given all local descriptions will be upgraded.
26
24
 
27
-
28
- ## OPTIONS
25
+ ## Options
29
26
 
30
27
  * `--all` (optional):
31
28
  Upgrade all stored system descriptions.
32
29
 
33
- ## ARGUMENTS
30
+ ## Arguments
34
31
 
35
32
  * `NAME` (optional):
36
33
  Upgrade specified system description.
37
34
 
38
-
39
- ## EXAMPLES
35
+ ## Examples
40
36
 
41
37
  * Upgrade the system description stored as `earth`:
42
38
 
@@ -1,14 +1,12 @@
1
-
2
1
  # validate — Validate System Description
3
2
 
4
- ## SYNOPSIS
3
+ ## Synopsis
5
4
 
6
5
  `machinery validate` NAME
7
6
 
8
7
  `machinery` help validate
9
8
 
10
-
11
- ## DESCRIPTION
9
+ ## Description
12
10
 
13
11
  The `validate` subcommand validates an existing system description.
14
12
  It checks, that the description has the correct structure and the data stored
@@ -20,14 +18,12 @@ In case of issues errors are shown with additional information.
20
18
  The main purpose of this command is to verify the system description after
21
19
  manually editing it.
22
20
 
23
-
24
- ## ARGUMENTS
21
+ ## Arguments
25
22
 
26
23
  * `NAME` (required):
27
24
  Name of the system description.
28
25
 
29
-
30
- ## EXAMPLES
26
+ ## Examples
31
27
 
32
28
  * Validate the system description with the name `myhost`:
33
29
 
@@ -1,50 +1,11 @@
1
1
  # Machinery — A Systems Management Toolkit for Linux
2
2
 
3
- # SYNOPSIS
3
+ # Synopsis
4
4
 
5
5
  `machinery` SUBCOMMAND \[options\] <br>
6
6
  `machinery` help [SUBCOMMAND]
7
7
 
8
-
9
- # DESCRIPTION
10
-
11
- Machinery is a systems management toolkit for Linux. It supports configuration
12
- discovery, system validation, and service migration. Machinery is based on the
13
- idea of an universal system description. Machinery has a set of commands which
14
- work with this system description. These commands can be combined to form work
15
- flows. Machinery is targeted at the system administrator of the data center.
16
-
17
-
18
- # WORK FLOW EXAMPLES
19
-
20
- ## Inspect a System and Show Results
21
- - `machinery inspect --extract-files --name=NAME HOSTNAME`
22
- - `machinery show NAME`
23
-
24
- ## Inspect Two Systems and Compare Them
25
- - `machinery inspect HOSTNAME1`
26
- - `machinery inspect HOSTNAME2`
27
- - `machinery compare HOSTNAME1 HOSTNAME2`
28
-
29
- ## Fully Inspect a System and Export a Kiwi Description
30
- - `machinery inspect --extract-files HOSTNAME`
31
- - `machinery export-kiwi --kiwi-dir=~/kiwi HOSTNAME`
32
-
33
- ## Fully Inspect a System and Export an AutoYaST Profile
34
- - `machinery inspect --extract-files HOSTNAME`
35
- - `machinery export-autoyast --autoyast-dir=~/autoyast HOSTNAME`
36
-
37
- ## Fully Inspect a System and Deploy a Replicate to the Cloud
38
- - `machinery inspect --extract-files HOSTNAME`
39
- - `machinery deploy --cloud-config=~/openrc.sh HOSTNAME`
40
-
41
- ## How to upgrade a SLES 11 SP3 system to SLES 12
42
- - Machinery can help you to upgrade without affecting the original system.
43
- For more details please read the Wiki Page: <br>
44
- https://github.com/SUSE/machinery/wiki/How-to-upgrade-a-SLES-11-SP3-system-to-SLES-12
45
-
46
-
47
- # CONCEPTUAL OVERVIEW
8
+ # Conceptual Overview
48
9
 
49
10
  Machinery's core concept is the complete representation of a system by a
50
11
  universal system description.
@@ -55,7 +16,7 @@ modifications.
55
16
  Machinery's subcommands work on the system description as the connecting
56
17
  element.
57
18
  System descriptions are obtained by inspecting systems, importing from other
58
- formats, manual creation or merging other descriptions.
19
+ formats, manual creation or merging existing descriptions.
59
20
  Machinery can store and modify system descriptions to allow changes to
60
21
  described state of the system.
61
22
  System descriptions can be compared to find similarities and differences
@@ -64,7 +25,7 @@ the system.
64
25
  System descriptions may be exported to other formats and can be used to
65
26
  migrate or replicate systems.
66
27
 
67
- Subcommands can be combined in different ways to accomodate higher-level work
28
+ Subcommands can be combined in different ways to accommodate higher-level work
68
29
  flows and use cases.
69
30
  These are some implemented and planned use cases:
70
31
 
@@ -100,6 +61,19 @@ Machinery is implemented as a command line tool named `machinery`. The
100
61
  subcommands work with the same system description identified by an optional
101
62
  name which can be used by all subcommands.
102
63
 
64
+ ## System Description
65
+
66
+ The System Description format and file structure is documented in the machinery
67
+ wiki: [System Description Format](https://github.com/SUSE/machinery/wiki/System-Description-Format).
68
+
69
+ Machinery validates descriptions on load. It checks that the JSON structure of
70
+ the manifest file, which contains the primary and meta data of a description, is
71
+ correct and it adheres to the schema. Validation errors are reported as warnings.
72
+ It also checks that the information about extracted files is consistent. Missing
73
+ files or extra files without reference in the manifest are treated also as
74
+ warnings. All other issues are errors which need to be fixed so that Machinery
75
+ can use the description.
76
+ To manually validate a description use the `machinery validate` command.
103
77
 
104
78
  ## Scopes
105
79
 
@@ -110,9 +84,19 @@ repositories, or changed configuration files.
110
84
  For example, if you are only interested in the installed packages, limit the
111
85
  scope to `packages`. This will output only the requested information.
112
86
 
113
- The the [scopes documentation](machinery_main_scopes.1) for a list of all supported scopes.
87
+ See the [Scopes documentation](machinery_main_scopes.1/) for a list of all supported scopes.
88
+
89
+ # Options for All Subcommands
90
+ <!--- These are 'global' options of machinery -->
114
91
 
115
- # FILES AND DEVICES
92
+ * `--version`:
93
+ Displays version of `machinery` tool. Exit when done.
94
+
95
+ * `--debug`:
96
+ Enable debug mode. Machinery writes additional information into the log
97
+ file which can be useful to track down problems.
98
+
99
+ # Files and Devices
116
100
 
117
101
  * `~/.machinery/machinery.config`:
118
102
 
@@ -122,18 +106,16 @@ The the [scopes documentation](machinery_main_scopes.1) for a list of all suppor
122
106
 
123
107
  Central log file, in the format date, time, process id, and log message.
124
108
 
125
- * `eth0` (SLE11) and `lan0` (SLE12):
109
+ * `em1 (openSUSE 13.2 / openSUSE leap)`, `eth0` (SLE11) and `lan0` (SLE12):
126
110
 
127
111
  First network device is used when DHCP in built image is enabled.
128
112
 
129
-
130
- # ENVIRONMENT
113
+ # Environment
131
114
 
132
115
  * `MACHINERY_LOG_FILE`:
133
116
 
134
- Location of Machinery's log file (defaults to `~/.machinery/machinery.log`)
135
-
117
+ Location of Machinery's log file (defaults to `~/.machinery/machinery.log`).
136
118
 
137
- # COPYRIGHT
119
+ # Copyright
138
120
 
139
121
  Copyright \(c) 2013-2016 [SUSE LLC](http://www.suse.com)
@@ -1,3 +1,5 @@
1
+ # Scopes
2
+
1
3
  * os
2
4
 
3
5
  Contains information about the operating system, name, version, and
@@ -5,25 +7,22 @@ architecture of the inspected system.
5
7
 
6
8
  * packages
7
9
 
8
- Contains information on all installed RPM packages installed on the
10
+ Contains information on all installed packages installed on the
9
11
  inspected system.
10
12
 
11
13
  * patterns
12
14
 
13
15
  Contains all patterns or tasks installed on the inspected system. A pattern is a
14
16
  collection of software packages, similar to the idea of tasks on Debian/Ubuntu-
15
- like systems.
16
- The meaning of software patterns depends on the package manager of the
17
- distribution. Therefore, the pattern scope on SUSE based systems uses the
18
- `zypper` command to obtain the information about installed pattern names, whereas
19
- on Debian based systems the `tasksel` tool is necessary to list installed tasks.
17
+ like systems. The meaning of software patterns depends on the package manager of the
18
+ distribution.
20
19
 
21
20
  * repositories
22
21
 
23
22
  Contains all information about software repositories configured on the
24
23
  inspected system. The information about repositories depends on the package
25
- manager of the distribution. Thus on SUSE-based systems the `zypper` command
26
- is used. Machinery collects the following information from each configured repository:
24
+ manager of the distribution. Machinery collects the following information
25
+ from each configured repository:
27
26
 
28
27
  - The alias name of the repository.
29
28
 
@@ -65,7 +64,7 @@ runlevel. It uses the `chkconfig` command to obtain that information.
65
64
  The xinetd services that are also displayed by `chkconfig` are switched
66
65
  on/off by editing configuration files and are ignored in this context.
67
66
 
68
- * changed_config_files
67
+ * changed-config-files
69
68
 
70
69
  Contains all configuration files which have been changed since they were
71
70
  installed.
@@ -74,22 +73,22 @@ package which has installed them. A configuration file change is reported
74
73
  if its content or its attributes like Linux permission bits or ownership
75
74
  have changed.
76
75
 
77
- * changed_managed_files
76
+ * changed-managed-files
78
77
 
79
78
  Contains the names and contents of all non-configuration files which have
80
79
  been changed compared to the files in the package. A file change is reported
81
80
  if its content or its attributes like Linux permission bits or ownership
82
81
  have changed.
83
82
 
84
- * unmanaged_files
83
+ * unmanaged-files
85
84
 
86
- Contains the names and contents of all files which are not part of any RPM
87
- package. The list of unmanaged files contains only plain files and
85
+ Contains the names and contents of all files which are not part of any package.
86
+ The list of unmanaged files contains only plain files and
88
87
  directories. Special files like device nodes, named pipes and Unix domain
89
88
  sockets are ignored. The directories `/tmp`, `/var/tmp`, `/.snapshots/`,
90
89
  `/var/run` and special mounts like procfs and sysfs are ignored, too.
91
90
  If a directory is in this list, no file or directory below it belongs to a
92
- RPM package.
91
+ package.
93
92
 
94
93
  Meta data information of unmanaged files is only available if the files were
95
94
  extracted during inspection.