Top Level Namespace

Defined Under Namespace

Modules: Helpers, RHN Classes: Activationkey, Activationkeys, ActivationkeysSet, Channel, Channels, ChannelsSet, Configchannel, Configchannels, ConfigchannelsSet, Configuration, Host, Kickstart, KickstartFilepreservation, KickstartFilepreservations, KickstartFilepreservationsSet, KickstartKey, KickstartKeys, KickstartKeysSet, KickstartSnippet, KickstartSnippets, KickstartSnippetsSet, Kickstarts, KickstartsSet, Launcher, Operation, OperationSet, Org, OrgTrust, OrgTrusts, OrgTrustsSet, Orgs, OrgsSet, SatOperator, System, SystemCustominfo, SystemCustominfos, SystemCustominfosSet, Systemgroup, Systemgroups, SystemgroupsSet, Systems, SystemsSet, User, Users, UsersSet

Instance Method Summary collapse

Instance Method Details

#config_syntaxObject



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'lib/satops.rb', line 111

def config_syntax
  %s{
# SatOps YAML comprehensive configuration file example
#
# Red Hat Network Satellite object groups
#   Activation Keys, Kickstart Profile, etc, with their specific options
#   An object group must be must be present to have a command executed against it
#
#   Options
#   'update' is a common option to allow corresponding object on target to be updated or not
#   Options are not mandatory - Default values are always either false, '' (empty) or nil
#
# Notes
#   YAML Format
#     Respect indentations using spaces not tabulations
#     Boolean values can be either yes/no or true/false
#     Receivers - left part of assignment are keywords: Do not change them!
#
Activationkeys:
  update: true
Configchannels:
  update: true
  # 'exclude' option provide a way to ignore some Config Channel objects
  # This is a list of regular expressions - Replace
  #exclude:
  #  - !ruby/regexp /^name1$/
  #  - !ruby/regexp /^name2$/
Channels:
  update: true
  delete: false
  # Triggers satellite-sync on Target providing the Source software channels
  iss: false
Kickstarts:
  update: true
KickstartFilepreservations:
  update: true
KickstartKeys:
  update: true
  # Type of keys. Default value is GPG. Other value would be SSL
  key_type: GPG
KickstartSnippets:
  update: true
Orgs:
  update: true
  entitlements: false
OrgTrusts:
  update: true
SystemCustominfos:
  update: true
Systems:
  update: true
Systemgroups:
  update: true
Users:
  update: true
  # Ignore deactivated users
  deactivated: false
  # By default extras users are deactivated not deleted
  delete: false
  # List of accounts to ignore
  exclude:
    - admin
    - satadmin
  # Default password used when creating user on target
  # It cannot be blank
  # When not using password then make sure PAM is activated
  password: "rhnapi"
}
end

#overwrite_net_httpObject



56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/satops.rb', line 56

def overwrite_net_http
  # https: Client certificate isn't verified by server so each session generates:
  # "warning: peer certificate won't be verified in this SSL session"
  # To get rid of this warning: thanks to http://www.5dollarwhitebox.org/drupal/node/64
  Net::HTTP.class_eval do
    alias_method :old_initialize, :initialize
    def initialize(*args)
      old_initialize(*args)
      @ssl_context = OpenSSL::SSL::SSLContext.new
      @ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE
    end
  end
end

#satellites_syntaxObject



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/satops.rb', line 181

def satellites_syntax
%s{
# This is an example of a Satellite configuration file for the satOps
#
# This is a YAML formatted file
# Respect indentations using spaces not tabulations
# Boolean values can be either yes/no or true/false
#
# Do not remove any line
# Change only login and passwd values
--- !ruby/object:Configuration
source: !ruby/object:Host
  name: sat1.example.org
  user:
    :login: admin
    :passwd: redhat
target: !ruby/object:Host
  name: sat2.example.org
  user:
    :login: admin
    :passwd: redhat
  }
end

#syntaxObject



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/satops.rb', line 74

def syntax
  %s{
Usage:
  satops show sat | config
  satops -s <sat file> -c <config file> [-dltw] destroy
  satops -s <sat file> -c <config file> [-dltw] export <directory> ascii | bin
  satops -s <sat file> -c <config file> [-dltw] import <directory> ascii | bin
  satops -s <sat file> -c <config file> [-dltw] run <Ruby file>
  satops -s <sat file> -c <config file> [-dltw] extras
  satops -s <sat file> -c <config file> [-dltw] sync
  satops [-h]

Mandatory Configuration:
  Sat file:    Source and Target RHN Satellites definition
  Config file: RHN Satellite objects and options
               Objects must be included to be processed
  Use 'show sat|config' command for generating either templates

Options:
  -d, --debug        Activate debug output
  -l, --log          Append logs to file. By default logs go to Standard Output
  -t, --tls          Activate SSL (HTTPS) sessions
  -w, --warnings     Activate Ruby Verbose

  -h, --help         Display this help and exit

Commands:
  destroy  Delete all objects on target RHN Satellite
  export   Export RHN Satellite objects to files (ascci or binary formats) into <directory>
  extras   Remove objects on target RHN Satellite not present in source RHN Satellite
  import   Import RHN Satellite object from files (ascii or binary) located into  <directory>
  run      Execute Ruby 'plug-in' file
  sync     Synchronise objects from source RHN Satellite to target RHN Satellite
  show     Generate configuration file examples
}
end