|
37 | 37 | #
|
38 | 38 | # @param grant_all_permissions
|
39 | 39 | #
|
40 |
| -define docker::plugin( |
41 |
| - Optional[Enum[present,absent]] $ensure = 'present', |
42 |
| - String $plugin_name = $title, |
43 |
| - Optional[Boolean] $enabled = true, |
44 |
| - Optional[String] $timeout = undef, |
45 |
| - Optional[String] $plugin_alias = undef, |
46 |
| - Optional[Boolean] $disable_on_install = false, |
47 |
| - Optional[Boolean] $disable_content_trust = true, |
48 |
| - Optional[Boolean] $grant_all_permissions = true, |
49 |
| - Optional[Boolean] $force_remove = true, |
50 |
| - Optional[Array] $settings = [], |
| 40 | +define docker::plugin ( |
| 41 | + Enum[present,absent] $ensure = 'present', |
| 42 | + String $plugin_name = $title, |
| 43 | + Boolean $enabled = true, |
| 44 | + Optional[String] $timeout = undef, |
| 45 | + Optional[String] $plugin_alias = undef, |
| 46 | + Boolean $disable_on_install = false, |
| 47 | + Boolean $disable_content_trust = true, |
| 48 | + Boolean $grant_all_permissions = true, |
| 49 | + Boolean $force_remove = true, |
| 50 | + Array $settings = [], |
51 | 51 | ) {
|
52 | 52 | include docker::params
|
53 | 53 |
|
|
58 | 58 | }
|
59 | 59 |
|
60 | 60 | if $ensure == 'present' {
|
61 |
| - $docker_plugin_install_flags = docker_plugin_install_flags( |
62 |
| - { |
| 61 | + $docker_plugin_install_flags = docker_plugin_install_flags( { |
63 | 62 | plugin_name => $plugin_name,
|
64 | 63 | plugin_alias => $plugin_alias,
|
65 | 64 | disable_on_install => $disable_on_install,
|
|
80 | 79 | unless => $unless_install,
|
81 | 80 | }
|
82 | 81 | } elsif $ensure == 'absent' {
|
83 |
| - $docker_plugin_remove_flags = docker_plugin_remove_flags( |
84 |
| - { |
| 82 | + $docker_plugin_remove_flags = docker_plugin_remove_flags( { |
85 | 83 | plugin_name => $plugin_name,
|
86 | 84 | force_remove => $force_remove,
|
87 | 85 | }
|
|
100 | 98 | }
|
101 | 99 |
|
102 | 100 | if $enabled {
|
103 |
| - $docker_plugin_enable_flags = docker_plugin_enable_flags( |
104 |
| - { |
| 101 | + $docker_plugin_enable_flags = docker_plugin_enable_flags( { |
105 | 102 | plugin_name => $plugin_name,
|
106 | 103 | plugin_alias => $plugin_alias,
|
107 | 104 | timeout => $timeout,
|
|
118 | 115 | timeout => 0,
|
119 | 116 | onlyif => $onlyif_enable,
|
120 | 117 | }
|
121 |
| - |
122 | 118 | } elsif $enabled == false {
|
123 | 119 | exec { "disable ${plugin_name}":
|
124 | 120 | command => "${docker_command} disable ${plugin_name}",
|
125 | 121 | environment => 'HOME=/root',
|
126 |
| - path => [ '/bin', '/usr/bin', ], |
| 122 | + path => ['/bin', '/usr/bin',], |
127 | 123 | timeout => 0,
|
128 | 124 | unless => "${docker_command} ls -f enabled=false --format='{{.PluginReference}}' | grep -w ${plugin_name}",
|
129 | 125 | }
|
|
0 commit comments