File tree 3 files changed +39
-8
lines changed
3 files changed +39
-8
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,14 @@ class { 'docker':
196
196
}
197
197
```
198
198
199
+ To uninstall docker, add the following to the manifest file:
200
+
201
+ ``` puppet
202
+ class { 'docker':
203
+ ensure => absent
204
+ }
205
+ ```
206
+
199
207
Only Docker EE is supported on Windows. To install docker on Windows 2016 and above the ` docker_ee ` parameter must be specified:
200
208
``` puppet
201
209
class { 'docker':
Original file line number Diff line number Diff line change 632
632
$root_dir_flag = ' --data-root'
633
633
}
634
634
635
- contain ' docker::repos'
636
- contain ' docker::install'
637
- contain ' docker::config'
638
- contain ' docker::service'
635
+ if $ensure != ' absent' {
636
+ contain ' docker::repos'
637
+ contain ' docker::install'
638
+ contain ' docker::config'
639
+ contain ' docker::service'
639
640
640
- Class[' docker::repos' ] -> Class[' docker::install' ] -> Class[' docker::config' ] -> Class[' docker::service' ]
641
- Class[' docker' ] -> Docker::Registry <||> -> Docker::Image <||>
642
- Class[' docker' ] -> Docker::Image <||>
643
- Class[' docker' ] -> Docker::Run <||>
641
+ Class[' docker::repos' ] -> Class[' docker::install' ] -> Class[' docker::config' ] -> Class[' docker::service' ]
642
+ Class[' docker' ] -> Docker::Registry <||> -> Docker::Image <||>
643
+ Class[' docker' ] -> Docker::Image <||>
644
+ Class[' docker' ] -> Docker::Run <||>
645
+ } else {
646
+ contain ' docker::repos'
647
+ contain ' docker::install'
644
648
649
+ Class[' docker::repos' ] -> Class[' docker::install' ]
650
+ }
645
651
}
Original file line number Diff line number Diff line change @@ -227,6 +227,23 @@ class { 'docker':
227
227
end
228
228
end
229
229
end
230
+
231
+
232
+ context 'uninstall docker' do
233
+ before ( :each ) do
234
+ @pp = <<-EOS
235
+ class {'docker':
236
+ ensure => 'absent'
237
+ }
238
+ EOS
239
+ apply_manifest ( @pp , :catch_failures => true )
240
+ sleep 4
241
+ end
242
+
243
+ it 'should uninstall successfully' do
244
+ shell ( 'docker ps' , :acceptable_exit_codes => [ 1 , 127 ] )
245
+ end
246
+ end
230
247
end
231
248
232
249
describe 'docker::image' do
You can’t perform that action at this time.
0 commit comments