Skip to content
This repository was archived by the owner on Nov 11, 2021. It is now read-only.

Solaris support #108

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ fixtures:
repositories:
stdlib: "git://github.com/puppetlabs/puppetlabs-stdlib.git"
concat: "git://github.com/puppetlabs/puppetlabs-concat.git"
netstdlib: "git://github.com/Yelp/puppet-netstdlib.git"
symlinks:
network: "#{source_dir}"
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,4 @@ gem 'coveralls', require: false
# Semantic Puppet
gem 'semantic_puppet', require: false
gem 'puppet-blacksmith', require: false
# vim: syntax=ruby
# vim: syntax=ruby
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ It manages hostname configuration and has hiera hash lookups to generate the fol
* Puppet version >= 2.7.x
* Facter version >= 1.6.2

ATTENTION: on Solaris an additional module is required:
* YELP [netstdlib module](https://github.com/Yelp/puppet-netstdlib)

This module will not get loaded automatically when installing from forge.

### Beginning with module network

The main class arguments can be provided either via Hiera (from Puppet 3.x) or direct parameters:
Expand Down Expand Up @@ -453,8 +458,10 @@ Configuration of multiple static routes (using the newer ```network::mroute``` d
This is tested on these OS:
- RedHat osfamily 5, 6 and 7
- Debian 6, 7 and 8
- Ubuntu 10.04, 12.04, 14.04, partly verified on Ubuntu 16.04
- Ubuntu 10.04, 12.04, 14.04, 16.04
- OpenSuse 12, SLES 11SP3, SLES 12 SP1 (ifrule files are only supported on Suse with wicked >= 0.6.33)
- Solaris 10 and 11
- OpenIndiana (OpenSolaris) 11 (Hipster release)


## Development
Expand Down
13 changes: 4 additions & 9 deletions manifests/interface.pp
Original file line number Diff line number Diff line change
Expand Up @@ -754,13 +754,14 @@
$create_ip_command = "ipadm create-addr -T dhcp ${title}/dhcp"
$show_ip_command = "ipadm show-addr ${title}/dhcp"
} else {
$create_ip_command = "ipadm create-addr -T static -a ${ipaddress}/${netmask} ${title}/v4static"
$cidr = netmask_to_masklen($netmask)
$create_ip_command = "ipadm create-addr -T static -a ${ipaddress}/${cidr} ${title}/v4static"
$show_ip_command = "ipadm show-addr ${title}/v4static"
}
}
default: {
$create_ip_command = 'true '
$show_ip_command = 'true '
$create_ip_command = '/usr/bin/true'
$show_ip_command = '/usr/bin/true'
}
}
exec { "create ipaddr ${title}":
Expand All @@ -776,12 +777,6 @@
require => Exec["create ipaddr ${title}"],
tag => 'solaris',
}
host { $::fqdn:
ensure => present,
ip => $ipaddress,
host_aliases => [$::hostname],
require => File["hostname iface ${title}"],
}
if ! defined(Service['svc:/network/physical:default']) {
service { 'svc:/network/physical:default':
ensure => running,
Expand Down
12 changes: 8 additions & 4 deletions spec/defines/network_interface_solaris_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@
it {
is_expected.to contain_host(node).with_ip('10.42.42.42')
}
end

it {
is_expected.to contain_service('svc:/network/physical:default').with_ensure('running')
}

describe 'Test network::interface on Solaris' do
it 'should create a hostname file' do
should contain_file('hostname iface eth0').with_content(/10.42.42.42/)
end
it 'should restart network service' do
should contain_service('svc:/network/physical:default').with_ensure('running')
end
end

end