Skip to content

Commit

Permalink
[CHORE] Tidy the apt_package resource (#2425)
Browse files Browse the repository at this point in the history
* [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 <[email protected]>

* remove ignore travis

Signed-off-by: IanMadd <[email protected]>

Co-authored-by: IanMadd <[email protected]>
Co-authored-by: Ian Maddaus <[email protected]>
  • Loading branch information
3 people authored Apr 23, 2020
1 parent f9b5ad8 commit 27b55f8
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 38 deletions.
1 change: 1 addition & 0 deletions .mdlrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rules "~MD013", "~MD032"
6 changes: 6 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
extends: default
rules:
line-length:
max: 120
level: warning
67 changes: 29 additions & 38 deletions content/resources/apt_package/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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.'
Expand Down Expand Up @@ -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
Expand All @@ -92,32 +89,22 @@ 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
required: false
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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
---

0 comments on commit 27b55f8

Please sign in to comment.