components/ruby/puppet/files/upgrade.sh
author Shawn Ferry <shawn.ferry@oracle.com>
Mon, 28 Nov 2016 16:54:02 -0800
changeset 7565 48aa82a0931f
permissions -rw-r--r--
PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0 19429313 address_object type should support vrrp addresses 19888183 publisher provider is applied on each puppet run 22125767 nsswitch provider missing ipnodes, protocols, printers 22126108 add process scheduler administration provider 22960016 Puppet needs a native way to set ZFS ACLs 23107546 race condition with smf provider and manifest-import 23119445 Upgrade Ruby Hiera to 3.2.0 23547788 Add ILB type to Puppet 23593229 rspec tests need to be written for solaris_providers boot_environment 23593308 rspec tests need to be written for solaris_providers ipmp_interface 23593316 rspec tests need to be written for solaris_providers protocol_properties 23593225 rspec tests need to be written for solaris_providers etherstub 23593319 rspec tests need to be written for solaris_providers vnic 23593310 puppet module rspec tests and validation for nsswitch 24674283 current puppet.stencil implementation restricts some valid puppet use cases 24680838 puppet agent failures should be visible to administrator via SMF interfaces 24681179 puppet's logadm.conf is pointing at wrong location for master, ignoring agent 24696742 puppet svccfg doesn't work for some value types 24696809 Puppet link aggregation modules cascading errors 24825868 Update to Puppet 4, Puppet 3 is EOL 24836004 '-' is valid in pkg mediator implementation 24836209 nis provider needs to support multiple securenets entries 24928890 keystone and horizon modules patches create invalid metadata.json 25022632 puppet ipmp_interface type should not validate interface existence 25022714 Puppet SMF service should not refresh on every apply operation 25225039 puppet svccfg should not declare a property absent if it does not match desired 25060925 puppet resource address_object generates invalid puppet code for dhcp interfaces 25065015 update puppet oracle-solaris_providers 2.0.0 25071521 puppet svccfg type should return a clear error if value is not provided 25071681 puppet dns resource generates invalid manifest 25071686 puppet resource ldap; Error: Could not run: No ability to determine if ldap... 25071690 puppet resource nis; Error: Could not run: No ability to determine if nis exists 25092384 puppet module files should be owned by root 25093408 puppet-solaris should be part of puppet again 25106150 Nis provider is not idempotent 25106155 DNS provider is not idempotent 25163776 puppet link_aggregation misunderstands 'address' -u output 25163791 puppet link_aggregation should use resource values instead of property_hash 25163815 puppet address_object errors and validations could be better 25163840 puppet Puppet::Property::List types conflict with internally generated arrays 25163864 puppet link_aggregation type specs need to be written 25177901 puppet beadm should not use both -e and -p 25178928 puppet link_aggregation should try to copy existing values on change of mode 25179040 puppet link_aggregation should delete with -t for temporary 25192742 puppet svccfg shouldn't try to update properties for a non-existent fmri 25196056 puppet interface and address _properties namevars are problematic 25191982 puppet type 'dns' is not able to set 'options' property in resolv.conf 25211935 puppet link_aggregation needs to permanently delete before modifying temporary 25217063 puppet protocol_properties is not idempotent 25218036 puppet resource svccfg emits a warning for every property 25218053 puppet svccfg prefetch should match individually specified parameters 25218208 puppet svccfg should enforce well-formedness in fmri parameters 25224661 puppet resource address_properties shouldn't output read-only properties 25224777 puppet address_properties should not reset unchanged properties 25306835 puppet boot_environment needs to understand the new snapshot format 25306877 puppet svccfg should check for pg and allow nested property groups 25306904 puppet dns,nis,ldap,protocol_properties prefetch fails after input auto munge 25348321 puppet boot_environment needs to validate all properties and parameters 25354751 puppet vnic provider needs to support / and - as valid vnic name characters
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7565
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
     1
#!/usr/bin/bash -e
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
     2
. /lib/svc/share/smf_include.sh
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
     3
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
     4
# Get Puppet 4 upgrade flag
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
     5
PUP4_X=$(/usr/bin/svcprop -p upgrade/4.x $SMF_FMRI)
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
     6
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
     7
# Get list of puppet FMRIs
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
     8
readarray -t PUPPET_FMRI <<< "$(svcs -H -o fmri application/puppet)"
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
     9
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    10
# Properties to remove if set
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    11
PUPPET_RM_PROP=(
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    12
stringify_facts trusted_node_data allow_variables_with_dashes
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    13
async_storeconfigs binder catalog_format certdnsnames
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    14
certificate_expire_warning couchdb_url dbadapter dbconnections
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    15
dblocation dbmigrate dbname dbpassword dbport dbserver dbsocket
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    16
dbuser dynamicfacts http_compression httplog ignoreimport
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    17
immutable_node_data inventory_port inventory_server
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    18
inventory_terminus legacy_query_parameter_serialization listen
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    19
localconfig manifestdir masterlog parser preview_outputdir puppetport
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    20
queue_source queue_type rails_loglevel railslog report_serialization_format
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    21
reportfrom rrddir rrdinterval sendmail smtphelo smtpport smtpserver
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    22
stringify_facts tagmap templatedir thin_storeconfigs trusted_node_data zlib
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    23
disable_warnings classfile vardir libdir rundir confdir ssldir)
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    24
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    25
# If additional migrations are needed in the future use a new prop
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    26
# and variable for the steps
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    27
if [ "$PUP4_X" == "true" ] ; then
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    28
  exit $SMF_EXIT_OK
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    29
fi
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    30
if [ "$PUP4_X" == "false" ]; then
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    31
  echo "Updating settings for Puppet 4"
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    32
  echo "Removing Out of Date Configuration Options"
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    33
  for fmri in ${PUPPET_FMRI[@]}
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    34
  do
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    35
    for prop in ${PUPPET_RM_PROP[@]}
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    36
    do
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    37
      printf "%s: " ${fmri}/:properties/config/${prop}
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    38
      # Don't exit on error
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    39
      set +e
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    40
      tmp=$(svcprop ${fmri}/:properties/config/${prop} 2> /dev/null)
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    41
      if [ ! -z ${tmp} ]; then
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    42
        svccfg -s $fmri delprop config/${prop} > /dev/null 2>&1
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    43
        # Reset exit on error
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    44
        print "removed (${tmp})"
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    45
      else
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    46
        print "not present"
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    47
      fi
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    48
      set -e
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    49
    done
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    50
  done
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    51
fi
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    52
svccfg -s $SMF_FMRI setprop upgrade/4.x = true
48aa82a0931f PSARC/2016/607 Puppet 4.7.0, Hiera 3.2.0
Shawn Ferry <shawn.ferry@oracle.com>
parents:
diff changeset
    53
svccfg -s $SMF_FMRI refresh