Skip to content

Commit

Permalink
Add ability to override service manager templates. Fixes sous-chefs#613.
Browse files Browse the repository at this point in the history
  • Loading branch information
heaven committed Dec 12, 2019
1 parent c626898 commit 3c6fea3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions libraries/mysql_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class MysqlService < MysqlServiceBase
property :package_name, String, default: lazy { default_package_name }, desired_state: false
property :package_options, [String, nil], desired_state: false
property :package_version, [String, nil], default: nil, desired_state: false
property :cookbook, String, desired_state: false, default: 'mysql'

################
# Helper Methods
Expand Down
6 changes: 3 additions & 3 deletions libraries/mysql_service_manager_systemd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MysqlServiceManagerSystemd < MysqlServiceBase
group 'root'
mode '0755'
variables(socket_file: socket_file)
cookbook 'mysql'
cookbook new_resource.cookbook
action :create
end

Expand All @@ -52,7 +52,7 @@ class MysqlServiceManagerSystemd < MysqlServiceBase
mysql_systemd_start_pre: mysql_systemd_start_pre,
mysql_systemd: mysql_systemd
)
cookbook 'mysql'
cookbook new_resource.cookbook
notifies :run, "execute[#{new_resource.instance} systemctl daemon-reload]", :immediately
action :create
end
Expand All @@ -75,7 +75,7 @@ class MysqlServiceManagerSystemd < MysqlServiceBase
run_user: new_resource.run_user,
run_group: new_resource.run_group
)
cookbook 'mysql'
cookbook new_resource.cookbook
action :create
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/mysql_service_manager_sysvinit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class MysqlServiceManagerSysvinit < MysqlServiceBase
pid_file: new_resource.pid_file,
scl_name: scl_name
)
cookbook 'mysql'
cookbook new_resource.cookbook
action :create
end

Expand Down
4 changes: 2 additions & 2 deletions libraries/mysql_service_manager_upstart.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class MysqlServiceManagerUpstart < MysqlServiceBase
group 'root'
mode '0755'
variables(socket_file: socket_file)
cookbook 'mysql'
cookbook new_resource.cookbook
action :create
end

Expand All @@ -41,7 +41,7 @@ class MysqlServiceManagerUpstart < MysqlServiceBase
run_user: new_resource.run_user,
socket_dir: new_resource.socket_dir
)
cookbook 'mysql'
cookbook new_resource.cookbook
action :create
end

Expand Down

0 comments on commit 3c6fea3

Please sign in to comment.