Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,14 @@ class { 'docker':
}
```

To uninstall docker, add the following to the manifest file:

```puppet
class { 'docker':
ensure => absent
}
```

Only Docker EE is supported on Windows. To install docker on Windows 2016 and above the `docker_ee` parameter must be specified:
```puppet
class { 'docker':
Expand Down
22 changes: 14 additions & 8 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -632,14 +632,20 @@
$root_dir_flag = '--data-root'
}

contain 'docker::repos'
contain 'docker::install'
contain 'docker::config'
contain 'docker::service'
if $ensure != 'absent' {
contain 'docker::repos'
contain 'docker::install'
contain 'docker::config'
contain 'docker::service'

Class['docker::repos'] -> Class['docker::install'] -> Class['docker::config'] -> Class['docker::service']
Class['docker'] -> Docker::Registry <||> -> Docker::Image <||>
Class['docker'] -> Docker::Image <||>
Class['docker'] -> Docker::Run <||>
Class['docker::repos'] -> Class['docker::install'] -> Class['docker::config'] -> Class['docker::service']
Class['docker'] -> Docker::Registry <||> -> Docker::Image <||>
Class['docker'] -> Docker::Image <||>
Class['docker'] -> Docker::Run <||>
} else {
contain 'docker::repos'
contain 'docker::install'

Class['docker::repos'] -> Class['docker::install']
}
}
17 changes: 17 additions & 0 deletions spec/acceptance/docker_full_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,23 @@ class { 'docker':
end
end
end


context 'uninstall docker' do
before(:each) do
@pp =<<-EOS
class {'docker':
ensure => 'absent'
}
EOS
apply_manifest(@pp, :catch_failures => true)
sleep 4
end

it 'should uninstall successfully' do
shell('docker ps', :acceptable_exit_codes => [1, 127])
end
end
end

describe 'docker::image' do
Expand Down