Showing with 21 additions and 15 deletions.
  1. +6 −0 CHANGELOG.md
  2. +2 −2 locales/config.yaml
  3. +2 −1 metadata.json
  4. +10 −12 spec/spec_helper_acceptance.rb
  5. +1 −0 tasks/init.json
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Release 0.1.2

### Fixed
- Fixed locales project name.
- Fixed cli description.

## Release 0.1.1
This is the initial release of the service task.

Expand Down
4 changes: 2 additions & 2 deletions locales/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
gettext:
# This is used for the name of the .pot and .po files; they will be
# called <project_name>.pot?
project_name: service
project_name: puppetlabs-service
# This is used in comments in the .pot and .po files to indicate what
# project the files belong to and should bea little more desctiptive than
# <project_name>
package_name: service
package_name: puppetlabs-service
# The locale that the default messages in the .pot file are in
default_locale: en
# The email used for sending bug reports.
Expand Down
3 changes: 2 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "puppetlabs-service",
"version": "0.1.1",
"version": "0.1.2",
"author": "puppet",
"summary": "Tasks that manipulate a service",
"description": "Tasks that manipulate a service",
"license": "Apache-2.0",
"source": "",
"dependencies": [],
Expand Down
22 changes: 10 additions & 12 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ def install_bolt_on(hosts)
on(hosts, "/opt/puppetlabs/puppet/bin/gem install --source http://rubygems.delivery.puppetlabs.net bolt -v '> 0.0.1'", acceptable_exit_codes: [0, 1]).stdout
end

run_puppet_install_helper
install_ca_certs unless ENV['PUPPET_INSTALL_TYPE'] =~ %r{pe}i
install_bolt_on(hosts) unless ENV['PUPPET_INSTALL_TYPE'] =~ %r{pe}i
install_module_on(hosts)
install_module_dependencies_on(hosts)
def pe_install?
ENV['PUPPET_INSTALL_TYPE'] =~ %r{pe}i
end

UNSUPPORTED_PLATFORMS = %w[Windows Solaris AIX].freeze
run_puppet_install_helper
install_ca_certs unless pe_install?
install_bolt_on(hosts) unless pe_install?
install_module_on(master)
install_module_dependencies_on([master])

DEFAULT_PASSWORD = if master[:hypervisor] == 'vagrant'
'vagrant'
Expand All @@ -25,10 +27,6 @@ def run_puppet_access_login(user:, password: '~!@#$%^*-/ aZ', lifetime: '5y')
on(master, puppet('access', 'login', '--username', user, '--lifetime', lifetime), stdin: password)
end

def pe_install?
ENV['PUPPET_INSTALL_TYPE'] =~ %r{pe}i
end

def run_task(task_name:, params: nil, password: DEFAULT_PASSWORD)
if pe_install?
run_puppet_task(task_name: task_name, params: params)
Expand All @@ -38,11 +36,11 @@ def run_task(task_name:, params: nil, password: DEFAULT_PASSWORD)
end

def run_bolt_task(task_name:, params: nil, password: DEFAULT_PASSWORD)
on(master, "/opt/puppetlabs/puppet/bin/bolt task run #{task_name} --modules /etc/puppetlabs/code/modules/service --nodes localhost --password #{password} #{params}", acceptable_exit_codes: [0, 1]).stdout # rubocop:disable Metrics/LineLength
on(master, "/opt/puppetlabs/puppet/bin/bolt task run #{task_name} --modules /etc/puppetlabs/code/modules/service --nodes #{fact_on(default, 'fqdn')} --password #{password} #{params}", acceptable_exit_codes: [0, 1]).stdout # rubocop:disable Metrics/LineLength
end

def run_puppet_task(task_name:, params: nil)
on(master, puppet('task', 'run', task_name, '--nodes', fact_on(master, 'fqdn'), params.to_s), acceptable_exit_codes: [0, 1]).stdout
on(master, puppet('task', 'run', task_name, '--nodes', fact_on(default, 'fqdn'), params.to_s), acceptable_exit_codes: [0, 1]).stdout
end

def expect_multiple_regexes(result:, regexes:)
Expand Down
1 change: 1 addition & 0 deletions tasks/init.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"summary": "Manage and inspect the state of services",
"description": "Manage and inspect the state of services",
"supports_noop": true,
"input_method": "stdin",
"parameters": {
Expand Down