Giter Club home page Giter Club logo

puppet-solaris_providers's Introduction

solaris_providers Module for Puppet

Build Status

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with solaris_providers
  1. Usage - Configuration options and additional functionality
  2. Limitations - OS compatibility, etc.
  3. Development - Guide for contributing to the module

Overview

The Oracle Solaris Providers module includes Solaris-specific implementations of types and providers. These include some common features as well as features found exclusively on Oracle Solaris.

Module Resource Type Reference

The Oracle Solaris Providers module currently enables configuration of the following:

  • Boot Environments via beadm
  • Naming Services via svccfg, svcprop
  • Image Pacakging System (IPS) configuration via pkg
  • Solaris Integrated Load Balancer (ILB) via ilbadm
  • Solaris Elastic Virtual Switch (EVS) via evsadm
  • Service Management Facility (SMF) Properties via svccfg, svcprop
  • IP Interface Configuration via ipadm
  • Datalink Management via dladm
  • ZFS ACLs and file Attributes via chmod

Oracle Solaris Providers override the core Puppet providers for:

  • Zones via zoneadm, zonecfg

See documentation index for details

Setup

For Solaris 11.4 (onwards) pkg install puppet

No additional setup or configuration is required.

Beginning with solaris_providers

Common activities include modifying service properties

Two ways to change the domain configuration:

  1. Via svccfg
 # Service is provided by Core Puppet
 # Make sure dns/client:default is running
 # Required for notification of property change
 service { 'svc:/network/dns/client:default':
   ensure => 'running'
 }
 # Set domain to oracle.lab, dns/client:default must be refreshed to
 # write the config to /etc/resolv.conf
 svccfg { 'svc:/network/dns/client:default/:properties/config/domain':
   ensure => 'present',
   type   => 'astring',
   value  => 'oracle.lab',
   notify => Service['svc:/network/dns/client:default'];
 }
  1. Via the DNS provider
# Set the domain to oracle.lab
dns { 'current':
  domain => 'oracle.lab'
}

Set the server for puppet/agent

  # enable puppet:agent
  service { 'svc:/application/puppet:agent':
    ensure => 'running'
  }
  # configure puppet:agent, refresh the service to write puppet.conf
  svccfg { 'svc:/application/puppet:agent/:properties/config/server':
    ensure => 'present',
    type   => 'astring',
    value  => 'puppet',
    notify => Service['svc:/application/puppet:agent'],
  }

Usage

See links to extracted documents listed above.

Limitations

These modules were created for use on Oracle Solaris 11 and 11.4.

Development

Contributors should issue pull requests via Github see contributing and testing.

Notes

Package installation is via Puppet Core package provider

Solaris providers are shipped with Solaris in the oracle-solaris_providers IPS package and installed automatically with puppet. Use of the module from this repo is possible but not addressed in this document.

puppet-solaris_providers's People

Contributors

alanc avatar brunoborges avatar einheber avatar saurabh-vyas avatar shawnferry avatar swdevula avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puppet-solaris_providers's Issues

svccfg updates everytime the same value when puppet run

I have created a resource
svccfg { 'svc:/network/dns/client/:properties/config/search':
ensure => 'present',
type => 'astring',
value => 'test.local.com',
notify => Service['svc:/network/dns/client:default'];
}

svcprop -s -f svc:/network/dns/client/:properties/config/search
test.local.com

The resource creates the property without any issue, but however when we ran the puppet agent again it keeps createing he same property and refreshing the service

"subsequent puppet run after the prpoerty search is created as expected"

Notice: /Stage[main]/Resolv_conf/Svccfg[svc:/network/dns/client/:properties/config/search]/ensure: created
Info: /Stage[main]/Resolv_conf/Svccfg[svc:/network/dns/client/:properties/config/search]: Scheduling refresh of Service[svc:/network/dns/client:default]

root#svcprop -s -f svc:/network/dns/client/:properties/config/search
test.local.com
root#

pkg_publisher: sslkey/sslcert marked as changed every time

When passing sslkey and sslcert to pkg_publisher, on subsequent runs it thinks the values have changed as the provider always reads them back out as nil.

Notice: /Stage[main]/Oracle::Packages/Pkg_publisher[exa-family]/sslkey: 
  sslkey changed '' to '/var/tmp/pkg.oracle.com.key'
Notice: /Stage[main]/Oracle::Packages/Pkg_publisher[exa-family]/sslcert: 
  sslcert changed '' to '/var/tmp/pkg.oracle.com.crt'

pkg_publisher does not appear to work in S12 (build 128)

The simplest example:

pkg_publisher { 'solaris':
  origin => 'http://pkg.oracle.com/solaris'
}

Produces the following output when the agent is run:

Info: Caching catalog for solgen2.us.oracle.com
Info: Applying configuration version 'd261b54492281811e27e7c460eb7ea9d006e76b2'
svcadm: Instance "svc:/application/puppet:agent" is not online.
Error: Failed to apply catalog: undefined method `include?' for nil:NilClass

Why doesn't assigning strings values containing spaces work?

There appears to be issues when specifying values that contain spaces.
eg:

nsswitch { 'current':
  group => 'files ldap',
}

The above returns an error:

Error: value: "files\\ ldap"
Execution of '/usr/sbin/svccfg -s svc:/system/name-service/switch setprop config/group=files\ ldap' returned 1: svccfg: Unknown type "files\".

Error: /Stage[main]/Profile::Base::Solaris::Ldap/Nsswitch[current]/group: change from 'files' to 'files ldap' failed: value: "files\\ ldap"
Execution of '/usr/sbin/svccfg -s svc:/system/name-service/switch setprop config/group=files\ ldap' returned 1: svccfg: Unknown type "files\".

But this does not occur if the value was set to "files ldap" manually.

pkg_publisher continually updates if 'origin' value ends with '/'

The following works fine and only adds the publisher once:

pkg_publisher { 'solaris':
  origin => 'http://pkg.us.oracle.com/solaris'
}

The following adds/updates the publisher multiple times (note the trailing '/' in the 'origin')

pkg_publisher { 'solaris':
  origin => 'http://pkg.us.oracle.com/solaris/'
}

oracle-solaris_providers not available via Puppet forge

The README has the following instructions to install these providers:

For Solaris 11.x puppet module install oracle-solaris_providers

This fails however:

root@test1:/etc/puppet/modules# puppet module install oracle-solaris_providers
Notice: Preparing to install into /etc/puppet/modules ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Error: Could not install 'oracle-solaris_providers' (latest)
  No releases are available from https://forgeapi.puppetlabs.com
    Does 'oracle-solaris_providers' have at least one published release?

puppet resource protocol_properties <proto> reports absent for individual protocols

puppet resource protocol_properties icmp
protocol_properties { 'icmp':
  ensure => 'absent',
}

vs

puppet resource protocol_properties
protocol_properties { 'dhcpv4':
  ensure     => 'present',
  properties => {'client-id' => '', 'offer-wait' => '', 'param-ignore-list' => '', 'param-request-list' => '', 'verified-lease-only' => ''},
}
protocol_properties { 'dhcpv6':
  ensure     => 'present',
  properties => {'client-id' => '', 'offer-wait' => '', 'param-ignore-list' => '', 'param-request-list' => '', 'verified-lease-only' => ''},
}
protocol_properties { 'icmp':
  ensure     => 'present',
  properties => {'max-buf' => '65536', 'recv-buf' => '8192', 'send-buf' => '8192'},
}
...

provider 'dns' requires a populated 'options' parameter or it fails

When using the 'dns' provider, if 'options' is not populated, the first Puppet run runs successfully, but subsequent runs gives the following error:

Error: Failed to apply catalog: undefined method `gsub' for nil:NilClass

I believe this is because of the following code snippet:

svcprop("-p", "config", Dns_fmri).each_line do |line|
fullprop, value = line.strip.split(" ", 3).values_at(0,2)
prop = fullprop.split("/")[1].intern
if Puppet::Type.type(:dns).validproperties.include? prop
if [:options,:nameserver,:search,:sortlist].include? prop
# remove escaped spaces, they are invalid in the resource
# output and break automatic list munging
value = value.gsub(/\\ /,' ')
end

That portion relies on the 1st and 3rd columns to be populated in the following svcprop output:

# svcprop -p config svc:/network/dns/client
config/domain astring us.oracle.com
config/nameserver net_address 10.209.76.197 10.209.76.198 192.135.82.132
config/options astring
config/search astring us.oracle.com oraclecorp.com oracle.com sun.com
config/value_authorization astring solaris.smf.value.name-service.dns.client

The "config/options" line does not have a column 3, so the "value" variables ends up empty and "value.gsub" throws the "nil:NilClass" error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.