From 27b55f8d224cde16804175d08b5363f705ce9f8e Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Thu, 23 Apr 2020 18:33:09 +0100 Subject: [PATCH] [CHORE] Tidy the apt_package resource (#2425) * [CHORE] Tidy the apt_package resource - Uses multi line yaml - Removes new lines where they are not required Adds markdown lint config Adds yamllint config Signed-off-by: Daniel Webb * remove ignore travis Signed-off-by: IanMadd Co-authored-by: IanMadd Co-authored-by: Ian Maddaus --- .mdlrc | 1 + .yamllint | 6 +++ content/resources/apt_package/_index.md | 67 +++++++++++-------------- 3 files changed, 36 insertions(+), 38 deletions(-) create mode 100644 .mdlrc create mode 100644 .yamllint diff --git a/.mdlrc b/.mdlrc new file mode 100644 index 0000000000..efa27cea1d --- /dev/null +++ b/.mdlrc @@ -0,0 +1 @@ +rules "~MD013", "~MD032" diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000000..a3dbc38eef --- /dev/null +++ b/.yamllint @@ -0,0 +1,6 @@ +--- +extends: default +rules: + line-length: + max: 120 + level: warning diff --git a/content/resources/apt_package/_index.md b/content/resources/apt_package/_index.md index ed24e5076c..7d347d5698 100644 --- a/content/resources/apt_package/_index.md +++ b/content/resources/apt_package/_index.md @@ -2,8 +2,7 @@ title: apt_package resource resource: apt_package draft: false -aliases: -- /resource_apt_package.html +aliases: [/resource_apt_package.html] menu: infra: title: apt_package @@ -13,9 +12,7 @@ menu: resource_reference: true robots: null resource_description_list: -- markdown: 'Use the **apt_package** resource to manage packages on Debian and - - Ubuntu platforms.' +- markdown: 'Use the **apt_package** resource to manage packages on Debian and Ubuntu platforms.' - note: shortcode: notes_resource_based_on_package.md resource_new_in: null @@ -25,26 +22,25 @@ syntax_description: 'A **apt_package** resource block manages a package on a nod by installing it. The simplest use of the **apt_package** resource is: - ``` ruby - apt_package ''package_name'' - ``` - - which will install the named package using all of the default options - - and the default action (`:install`).' + which will install the named package using all of the default options and the default action (`:install`).' syntax_code_block: null syntax_properties_list: null -syntax_full_code_block: "apt_package 'name' do\n default_release String\n\ - \ options String, Array\n overwrite_config_files true,\ - \ false # default value: false\n package_name String, Array\n \ - \ response_file String\n response_file_variables Hash\n timeout\ - \ String, Integer\n version String, Array\n\ - \ action Symbol # defaults to :install if not specified\n\ - end" +syntax_full_code_block: | + apt_package 'name' do + default_release String + options String, Array + overwrite_config_files true, false # default value: false + package_name String, Array + response_file String + response_file_variables Hash + timeout String, Integer + version String, Array + action Symbol # defaults to :install if not specified + end syntax_full_properties_list: - '`apt_package` is the resource.' - '`name` is the name given to the resource block.' @@ -77,6 +73,7 @@ actions_list: markdown: Unlocks the apt package so that it can be upgraded to a newer version. :upgrade: markdown: Install a package and/or ensure that a package is the latest version. + properties_list: - property: default_release ruby_type: String @@ -92,13 +89,7 @@ properties_list: new_in: null description_list: - markdown: 'One (or more) additional options that are passed to the command. For - - example, common apt-get directives, such as - - `--no-install-recommends`. See the [apt-get man - - page](http://manpages.ubuntu.com/manpages/zesty/man8/apt-get.8.html) - + example, common apt-get directives, such as `--no-install-recommends`. See the [apt-get man page](http://manpages.ubuntu.com/manpages/zesty/man8/apt-get.8.html) for the full list.' - property: overwrite_config_files ruby_type: true, false @@ -106,18 +97,14 @@ properties_list: default_value: 'false' new_in: '14.0' description_list: - - markdown: 'Overwrite existing configuration files with those supplied by the - - package, if prompted by APT.' + - markdown: 'Overwrite existing configuration files with those supplied by the package, if prompted by APT.' - property: package_name ruby_type: String, Array required: false default_value: null new_in: null description_list: - - markdown: 'An optional property to set the package name if it differs from the - - resource block''s name.' + - markdown: An optional property to set the package name if it differs from the resource block's name. - property: response_file ruby_type: String required: false @@ -131,9 +118,7 @@ properties_list: default_value: null new_in: null description_list: - - markdown: 'A Hash of response file variables in the form of {''VARIABLE'' =\> - - ''VALUE''}.' + - markdown: "A Hash of response file variables in the form of { 'VARIABLE' => 'VALUE' }." - property: timeout ruby_type: String, Integer required: false @@ -148,6 +133,7 @@ properties_list: new_in: null description_list: - markdown: The version of a package to be installed or upgraded. + properties_shortcode: null properties_multiple_packages: false resource_directory_recursive_directories: false @@ -172,9 +158,14 @@ unit_file_verification: false examples_list: - example_heading: Install a package using package manager text_blocks: - - code_block: "apt_package 'name of package' do\n action :install\nend" + - code_block: | + apt_package 'name of package' do + action :install + end - example_heading: Install without using recommend packages as a dependency text_blocks: - - code_block: "package 'apache2' do\n options '--no-install-recommends'\nend" - + - code_block: | + package 'apache2' do + options '--no-install-recommends' + end ---