summaryrefslogtreecommitdiff
path: root/src/Propellor/Types/OS.hs
diff options
context:
space:
mode:
authorEvan Cofsky2016-02-26 10:20:21 -0600
committerEvan Cofsky2016-03-07 13:31:51 -0600
commit822694e790102efa2a5bb4a0c3d62c6fce1d4e87 (patch)
tree833ade451e379c641e9cf5de46cc81d02d8fefbc /src/Propellor/Types/OS.hs
parente8f36722bf23a19dcdd42a1c14ebaa40a2d73293 (diff)
FreeBSD Support including:
- Propellor bootstrapping - Basic pkg - Basic ZFS datasets and properties - Simple Poudriere configuration (regular and ZFS) - Poudriere jail creation FIXME: - Cron.hs: runPropellor needs the System, but hasn't yet gotten it. Reorganizing: - Remove FreeBSD.Process - Move ZFS up to Property - Add Info for Pkg.update/Pkg.upgrade - Move FreeBSD.md to doc so it'll show up automatically. - Merge the FreeBSD config with the other sample config. - Use Info to check Pkg updated/upgraded and Poudriere configured. - Warnings clean-up, move ZFS types to Propellor.Types. - Maintainer and license statements.
Diffstat (limited to 'src/Propellor/Types/OS.hs')
-rw-r--r--src/Propellor/Types/OS.hs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/Propellor/Types/OS.hs b/src/Propellor/Types/OS.hs
index c302d11d..5b425f71 100644
--- a/src/Propellor/Types/OS.hs
+++ b/src/Propellor/Types/OS.hs
@@ -4,6 +4,8 @@ module Propellor.Types.OS (
System(..),
Distribution(..),
DebianSuite(..),
+ FreeBSDRelease(..),
+ FBSDVersion(..),
isStable,
Release,
Architecture,
@@ -17,6 +19,7 @@ module Propellor.Types.OS (
import Network.BSD (HostName)
import Data.Typeable
+import Data.String
-- | High level description of a operating system.
data System = System Distribution Architecture
@@ -25,6 +28,7 @@ data System = System Distribution Architecture
data Distribution
= Debian DebianSuite
| Buntish Release -- ^ A well-known Debian derivative founded by a space tourist. The actual name of this distribution is not used in Propellor per <http://joeyh.name/blog/entry/trademark_nonsense/>)
+ | FreeBSD FreeBSDRelease
deriving (Show, Eq)
-- | Debian has several rolling suites, and a number of stable releases,
@@ -32,6 +36,24 @@ data Distribution
data DebianSuite = Experimental | Unstable | Testing | Stable Release
deriving (Show, Eq)
+-- | FreeBSD breaks their releases into "Production" and "Legacy".
+data FreeBSDRelease = FBSDProduction FBSDVersion | FBSDLegacy FBSDVersion
+ deriving (Show, Eq)
+
+data FBSDVersion = FBSD101 | FBSD102 | FBSD093
+ deriving (Eq)
+
+instance IsString FBSDVersion where
+ fromString "10.1-RELEASE" = FBSD101
+ fromString "10.2-RELEASE" = FBSD102
+ fromString "9.3-RELEASE" = FBSD093
+ fromString _ = error "Invalid FreeBSD release"
+
+instance Show FBSDVersion where
+ show FBSD101 = "10.1-RELEASE"
+ show FBSD102 = "10.2-RELEASE"
+ show FBSD093 = "9.3-RELEASE"
+
isStable :: DebianSuite -> Bool
isStable (Stable _) = True
isStable _ = False