suitmymind-ubuntu-machine 0.0.2 → 0.0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -47,4 +47,19 @@ namespace :machine do
|
|
47
47
|
git.install
|
48
48
|
php.install
|
49
49
|
end
|
50
|
+
|
51
|
+
desc = "Ask for a user and change his password"
|
52
|
+
task :change_password do
|
53
|
+
user_to_update = Capistrano::CLI.ui.ask("Name of the user whose you want to update the password : ")
|
54
|
+
|
55
|
+
sudo "passwd #{user_to_update}", :pty => true do |ch, stream, data|
|
56
|
+
if data =~ /Enter new UNIX password/ || data=~ /Retype new UNIX password:/
|
57
|
+
# prompt, and then send the response to the remote process
|
58
|
+
ch.send_data(Capistrano::CLI.password_prompt(data) + "\n")
|
59
|
+
else
|
60
|
+
# use the default handler for all other text
|
61
|
+
Capistrano::Configuration.default_io_proc.call(ch, stream, data)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
50
65
|
end
|
@@ -57,4 +57,13 @@ namespace :mysql do
|
|
57
57
|
sudo "aptitude install -y libmysql-ruby1.8"
|
58
58
|
run "mysqladmin -u root password #{db_root_password}"
|
59
59
|
end
|
60
|
+
|
61
|
+
desc "Ask for a MySQL user and change his password"
|
62
|
+
task :change_password, :roles => :db do
|
63
|
+
user_to_update = Capistrano::CLI.ui.ask("Name of the MySQL user whose you want to update the password : ")
|
64
|
+
old_password = Capistrano::CLI.ui.ask("Old password for #{user_to_update} : ")
|
65
|
+
new_password = Capistrano::CLI.ui.ask("New password for #{user_to_update} : ")
|
66
|
+
|
67
|
+
run "mysqladmin -u #{user_to_update} -p#{old_password} password \"#{new_password}\""
|
68
|
+
end
|
60
69
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: suitmymind-ubuntu-machine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.2
|
4
|
+
version: 0.0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Balthazar
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-01-02 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|