propellor-5.3.3: property-based host configuration management in haskell

Safe Haskell | None
Language | Haskell98

Propellor.Property.Apt

Synopsis

- data HostMirror = HostMirror Url
- data HostAptProxy = HostAptProxy Url
- mirror :: Url -> Property (HasInfo + UnixLike)
- getMirror :: Propellor Url
- withMirror :: Desc -> (Url -> Property DebianLike) -> Property DebianLike
- sourcesList :: FilePath
- type Url = String
- type Section = String
- type SourcesGenerator = DebianSuite -> [Line]
- showSuite :: DebianSuite -> String
- backportSuite :: DebianSuite -> Maybe String
- stableUpdatesSuite :: DebianSuite -> Maybe String
- debLine :: String -> Url -> [Section] -> Line
- srcLine :: Line -> Line
- stdSections :: [Section]
- binandsrc :: String -> SourcesGenerator
- stdArchiveLines :: Propellor SourcesGenerator
- securityUpdates :: SourcesGenerator
- stdSourcesList :: Property Debian
- stdSourcesListFor :: DebianSuite -> Property Debian
- stdSourcesList' :: DebianSuite -> [SourcesGenerator] -> Property Debian
- type PinPriority = Int
- suiteAvailablePinned :: DebianSuite -> PinPriority -> RevertableProperty Debian Debian
- setSourcesList :: [Line] -> Property DebianLike
- setSourcesListD :: [Line] -> FilePath -> Property DebianLike
- runApt :: [String] -> UncheckedProperty DebianLike
- noninteractiveEnv :: [(String, String)]
- update :: Property DebianLike
- upgrade :: Property DebianLike
- upgrade' :: String -> Property DebianLike
- safeUpgrade :: Property DebianLike
- pendingConfigured :: Property DebianLike
- type Package = String
- installed :: [Package] -> Property DebianLike
- installed' :: [String] -> [Package] -> Property DebianLike
- installedBackport :: [Package] -> Property Debian
- installedMin :: [Package] -> Property DebianLike
- removed :: [Package] -> Property DebianLike
- buildDep :: [Package] -> Property DebianLike
- buildDepIn :: FilePath -> Property DebianLike
- type AptPackagePref = String
- pinnedTo :: [AptPackagePref] -> [(DebianSuite, PinPriority)] -> RevertableProperty Debian Debian
- pinnedTo' :: AptPackagePref -> [(DebianSuite, PinPriority)] -> RevertableProperty Debian Debian
- robustly :: Property DebianLike -> Property DebianLike
- isInstalled :: Package -> IO Bool
- isInstalled' :: [Package] -> IO Bool
- data InstallStatus
  - = IsInstalled
  - | NotInstalled
- getInstallStatus :: [Package] -> IO [InstallStatus]
- autoRemove :: Property DebianLike
- unattendedUpgrades :: RevertableProperty DebianLike DebianLike
- periodicUpdates :: Property DebianLike
- type DebconfTemplate = String
- type DebconfTemplateType = String
- type DebconfTemplateValue = String
- reConfigure :: Package -> [(DebconfTemplate, DebconfTemplateType, DebconfTemplateValue)] -> Property DebianLike
- serviceInstalledRunning :: Package -> Property DebianLike
- data AptKey = AptKey {
  - keyname :: String
  - pubkey :: String
  }
- trustsKey :: AptKey -> RevertableProperty DebianLike DebianLike
- trustsKey' :: AptKey -> Property DebianLike
- untrustKey :: AptKey -> Property DebianLike
- aptKeyFile :: AptKey -> FilePath
- cacheCleaned :: Property DebianLike
- hasForeignArch :: String -> Property DebianLike
- noPDiffs :: Property DebianLike
- suitePin :: DebianSuite -> String
- suitePinBlock :: AptPackagePref -> DebianSuite -> PinPriority -> [Line]
- dpkgStatus :: FilePath
- proxy :: Url -> Property (HasInfo + DebianLike)
- proxy' :: Url -> Property DebianLike
- useLocalCacher :: Property (HasInfo + DebianLike)

# Documentation

data HostMirror Source #

Constructors

HostMirror Url |

Instances

Eq HostMirror Source # |
Methods (==) :: HostMirror -> HostMirror -> Bool (/=) :: HostMirror -> HostMirror -> Bool
Show HostMirror Source # |
Methods showsPrec :: Int -> HostMirror -> ShowS show :: HostMirror -> String showList :: [HostMirror] -> ShowS

data HostAptProxy Source #

Constructors

HostAptProxy Url |

Instances

Eq HostAptProxy Source # |
Methods (==) :: HostAptProxy -> HostAptProxy -> Bool (/=) :: HostAptProxy -> HostAptProxy -> Bool
Show HostAptProxy Source # |
Methods showsPrec :: Int -> HostAptProxy -> ShowS show :: HostAptProxy -> String showList :: [HostAptProxy] -> ShowS

mirror :: Url -> Property (HasInfo + UnixLike) Source #

Indicate host's preferred apt mirror

getMirror :: Propellor Url Source #

withMirror :: Desc -> (Url -> Property DebianLike) -> Property DebianLike Source #

sourcesList :: FilePath Source #

type Url = String Source #

type Section = String Source #

type SourcesGenerator = DebianSuite -> [Line] Source #

showSuite :: DebianSuite -> String Source #

backportSuite :: DebianSuite -> Maybe String Source #

stableUpdatesSuite :: DebianSuite -> Maybe String Source #

debLine :: String -> Url -> [Section] -> Line Source #

srcLine :: Line -> Line Source #

stdSections :: [Section] Source #

binandsrc :: String -> SourcesGenerator Source #

stdArchiveLines :: Propellor SourcesGenerator Source #

securityUpdates :: SourcesGenerator Source #

Only available for Stable and Testing

stdSourcesList :: Property Debian Source #

Makes sources.list have a standard content using the Debian mirror CDN (or other host specified using the `mirror` property), with the Debian suite configured by the os.

stdSourcesListFor :: DebianSuite -> Property Debian Source #

stdSourcesList' :: DebianSuite -> [SourcesGenerator] -> Property Debian Source #

Adds additional sources.list generators.

Note that if a Property needs to enable an apt source, it's better to do so via a separate file in /etc/apt/sources.list.d/

type PinPriority = Int Source #

suiteAvailablePinned :: DebianSuite -> PinPriority -> RevertableProperty Debian Debian Source #

Adds an apt source for a suite, and pins that suite to a given pin value (see apt_preferences(5)). Revert to drop the source and unpin the suite.

If the requested suite is the host's OS suite, the suite is pinned, but no source is added. That apt source should already be available, or you can use a property like `stdSourcesList`.

setSourcesList :: [Line] -> Property DebianLike Source #

setSourcesListD :: [Line] -> FilePath -> Property DebianLike Source #

runApt :: [String] -> UncheckedProperty DebianLike Source #

noninteractiveEnv :: [(String, String)] Source #

update :: Property DebianLike Source #

Have apt update its lists of packages, but without upgrading anything.

upgrade :: Property DebianLike Source #

Have apt upgrade packages, adding new packages and removing old as necessary. Often used in combination with the `update` property.

upgrade' :: String -> Property DebianLike Source #

safeUpgrade :: Property DebianLike Source #

Have apt upgrade packages, but never add new packages or remove old packages. Not suitable for upgrading acrocess major versions of the distribution.

pendingConfigured :: Property DebianLike Source #

Have dpkg try to configure any packages that are not fully configured.

type Package = String Source #

installed :: [Package] -> Property DebianLike Source #

installed' :: [String] -> [Package] -> Property DebianLike Source #

installedBackport :: [Package] -> Property Debian Source #

installedMin :: [Package] -> Property DebianLike Source #

Minimal install of package, without recommends.

removed :: [Package] -> Property DebianLike Source #

buildDep :: [Package] -> Property DebianLike Source #

buildDepIn :: FilePath -> Property DebianLike Source #

Installs the build deps for the source package unpacked in the specifed directory, with a dummy package also installed so that autoRemove won't remove them.

type AptPackagePref = String Source #

The name of a package, a glob to match the names of packages, or a regexp surrounded by slashes to match the names of packages. See apt_preferences(5), "Regular expressions and glob(7) syntax"

pinnedTo :: [AptPackagePref] -> [(DebianSuite, PinPriority)] -> RevertableProperty Debian Debian Source #

Pins a list of packages, package wildcards and/or regular expressions to a list of suites and corresponding pin priorities (see apt_preferences(5)). Revert to unpin.

Each package, package wildcard or regular expression will be pinned to all of the specified suites.

Note that this will have no effect unless there is an apt source for each of the suites. One way to add an apt source is `suiteAvailablePinned`.

For example, to obtain Emacs Lisp addon packages not present in your release of Debian from testing, falling back to sid if they're not available in testing, you could use

    & Apt.suiteAvailablePinned Testing (-10)
    & Apt.suiteAvailablePinned Unstable (-10)
    & ["elpa-*"] `Apt.pinnedTo` [(Testing, 100), (Unstable, 50)]

pinnedTo' :: AptPackagePref -> [(DebianSuite, PinPriority)] -> RevertableProperty Debian Debian Source #

robustly :: Property DebianLike -> Property DebianLike Source #

Package installation may fail becuse the archive has changed. Run an update in that case and retry.

isInstalled :: Package -> IO Bool Source #

isInstalled' :: [Package] -> IO Bool Source #

data InstallStatus Source #

Constructors

IsInstalled |
NotInstalled |

Instances

Eq InstallStatus Source # |
Methods (==) :: InstallStatus -> InstallStatus -> Bool (/=) :: InstallStatus -> InstallStatus -> Bool
Show InstallStatus Source # |
Methods showsPrec :: Int -> InstallStatus -> ShowS show :: InstallStatus -> String showList :: [InstallStatus] -> ShowS

getInstallStatus :: [Package] -> IO [InstallStatus] Source #

autoRemove :: Property DebianLike Source #

unattendedUpgrades :: RevertableProperty DebianLike DebianLike Source #

Enables unattended upgrades. Revert to disable.

periodicUpdates :: Property DebianLike Source #

Enable periodic updates (but not upgrades), including download of packages.

type DebconfTemplate = String Source #

type DebconfTemplateType = String Source #

type DebconfTemplateValue = String Source #

reConfigure :: Package -> [(DebconfTemplate, DebconfTemplateType, DebconfTemplateValue)] -> Property DebianLike Source #

Preseeds debconf values and reconfigures the package so it takes effect.

serviceInstalledRunning :: Package -> Property DebianLike Source #

Ensures that a service is installed and running.

Assumes that there is a 1:1 mapping between service names and apt package names.

data AptKey Source #

Constructors

AptKey |

Fields

- keyname :: String
- pubkey :: String

trustsKey :: AptKey -> RevertableProperty DebianLike DebianLike Source #

trustsKey' :: AptKey -> Property DebianLike Source #

untrustKey :: AptKey -> Property DebianLike Source #

aptKeyFile :: AptKey -> FilePath Source #

cacheCleaned :: Property DebianLike Source #

Cleans apt's cache of downloaded packages to avoid using up disk space.

hasForeignArch :: String -> Property DebianLike Source #

Add a foreign architecture to dpkg and apt.

noPDiffs :: Property DebianLike Source #

Disable the use of PDiffs for machines with high-bandwidth connections.

suitePin :: DebianSuite -> String Source #

suitePinBlock :: AptPackagePref -> DebianSuite -> PinPriority -> [Line] Source #

dpkgStatus :: FilePath Source #

proxy :: Url -> Property (HasInfo + DebianLike) Source #

Set apt's proxy

proxy' :: Url -> Property DebianLike Source #

useLocalCacher :: Property (HasInfo + DebianLike) Source #

Cause apt to proxy downloads via an apt cacher on localhost