foreman_users 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -67,15 +67,21 @@ class ForemanUsers::Syuser < ActiveRecord::Base
67
67
  def create_content
68
68
  #content = "class users { " + "\n" + "\s\s" + "include baseline::params" + "\n" + "\s\s" + "@user {'$user':" + "\n" + "\s\s\s\s" + "ensure => $user_ensure," + "\n" + "\s\s\s\s" + "home => $user_home," + "\n" + "\s\s" + "}" + "\n" + "}"
69
69
  #
70
- user_content = "class users {" + "\n" + "\s\s" + "user { '" + self.name + "':" + "\n\s\s\s\s" + "ensure => '" + self.ensure + "'," + "\n\s\s\s\s" + "gid => '" + self.gid + "'," + "\n\s\s\s\s" + "groups => [" + self.groups + "]," + "\n\s\s\s\s" + "home => '" + self.home + "'," + "\n\s\s\s\s" + "password => '" + self.password + "'," + "\n\s\s\s\s" + "password_max_age => '" + self.password_max_age + "'," + "\n\s\s\s\s" + "password_min_age => '" + self.password_min_age + "'," + "\n\s\s\s\s" + "shell => '" + self.shell + "'," + "\n\s\s\s\s" + "uid => '" + self.uid + "'," + "\n\s\s" +"}" + "\n"
70
+ title_content = "class users {"
71
71
 
72
- group_content = "\s\s"
73
- if self.sygroups.size > 0
74
- self.sygroups.each do |sygroup|
75
- group_content += "group {'"+ sygroup.name + "':" + "\n\s\s\s\s" + "ensure => '" + sygroup.ensure + "'," + "\n\s\s\s\s" + "gid => '" + sygroup.gid + "'," + "\n\s\s" +"}" + "\n\s\s"
76
- end
72
+ ForemanUsers::SyUser.all.each do |syuser|
73
+ user_content = "\n" + "\s\s" + "user { '" + syuser.name + "':" + "\n\s\s\s\s" + "ensure => '" + syuser.ensure + "'," + "\n\s\s\s\s" + "gid => '" + syuser.gid + "'," + "\n\s\s\s\s" + "groups => [" + syuser.groups + "]," + "\n\s\s\s\s" + "home => '" + syuser.home + "'," + "\n\s\s\s\s" + "password => '" + syuser.password + "'," + "\n\s\s\s\s" + "password_max_age => '" + syuser.password_max_age + "'," + "\n\s\s\s\s" + "password_min_age => '" + syuser.password_min_age + "'," + "\n\s\s\s\s" + "shell => '" + syuser.shell + "'," + "\n\s\s\s\s" + "uid => '" + syuser.uid + "'," + "\n\s\s" +"}" + "\n"
74
+
75
+ group_content = "\s\s"
76
+ if syuser.sygroups.size > 0
77
+ syuser.sygroups.each do |sygroup|
78
+ group_content += "group {'"+ sygroup.name + "':" + "\n\s\s\s\s" + "ensure => '" + sygroup.ensure + "'," + "\n\s\s\s\s" + "gid => '" + sygroup.gid + "'," + "\n\s\s" +"}" + "\n\s\s"
79
+ end
80
+ end
81
+ title_content = title_content + user_content + group_content
77
82
  end
78
- rs = user_content + group_content + "\n" + "}"
83
+
84
+ rs = title_content + "\n" + "}"
79
85
  return rs
80
86
  end
81
87
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanUsers
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_users
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: