diff --git a/manifests/site.pp b/manifests/site.pp index 08573c2..08e5a02 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -10,39 +10,48 @@ include notify } -#$myname1 = 'lala' -#class example { -# $myname2 = 'suhua' -# notify {"Message from elsewhere: $myname1, $myname2": -# -# } -#} -#notify {"I love you $myname1, $myname2":} - -$global_variable = 'global' - -File { - ensure => file, - owner => 'suhua' -} - node ubuntu-test2 { - #include example - #$parent_variable = 'parent' - #include scope_example + + # if + if $operatingsystem == 'Ubuntu' { + notify { "I am running on $operatingsystem.": + + } + } + elsif $operatingsystem == 'CentOS' { + notify { "Who are you?": + + } + } + + # in + if $operatingsystem in ['Ubuntu', 'CentOS'] { + notify { "I am ruuning on $operatingsystem.": - $myname = 'suhuazizi' - $mybody = 'lalalal' - $num = 10 - notify{ "${myname}${mybody} is am good boy.": + } + } + # case + case $operatingsystem { + 'Ubuntu': { + $variable = 'ubuntu' + } + 'CentOS': { + $variable = 'centos' + } } - notify { "environment: $environment, cert: $clientcert, version: $clientversion": + notify { "I an running on $variable.": + + } + # selector + $mysystem = $operatingsystem ? { + 'Ubuntu' => 'ubuntu-xxx', + 'CentOS' => 'centos-xxx', } - notify { "servername: $servername, serverip: $serverip, version: $serverversion, module: $module_name": + notify { "I am running on $mysystem": } }