|
44 | 44 | # read the client key |
45 | 45 | _client_pem_path = os.path.join(CHEF_CONFIG_PATH, 'client.pem') |
46 | 46 | CHEF_CLIENT_KEY = subprocess.check_output( |
47 | | - ['sudo', '/bin/cat', _client_pem_path]).strip('\n') |
| 47 | + ['/bin/cat', _client_pem_path]).strip('\n') |
48 | 48 | # read the validation key |
49 | 49 | _valid_pem_path = os.path.join(CHEF_CONFIG_PATH, 'validation.pem') |
50 | 50 | CHEF_VALIDATION_KEY = subprocess.check_output( |
51 | | - ['sudo', '/bin/cat', _valid_pem_path]).strip('\n') |
| 51 | + ['/bin/cat', _valid_pem_path]).strip('\n') |
52 | 52 | except Exception as err: |
53 | 53 | msg = "Failed to auto-configure Chef -- {}".format(err) |
54 | 54 | if os.environ.get('READTHEDOCS'): |
@@ -90,6 +90,7 @@ def bootstrap_node(node): |
90 | 90 | f.write(node['ssh_private_key']) |
91 | 91 | # build knife bootstrap command |
92 | 92 | args = ['knife', 'bootstrap', node['fqdn']] |
| 93 | + args.extend(['--config', '/etc/chef/client.rb']) |
93 | 94 | args.extend(['--identity-file', pk_path]) |
94 | 95 | args.extend(['--node-name', node['id']]) |
95 | 96 | args.extend(['--sudo', '--ssh-user', node['ssh_username']]) |
@@ -158,13 +159,14 @@ def converge_controller(): |
158 | 159 |
|
159 | 160 | :returns: the output of the convergence command, in this case `sudo chef-client` |
160 | 161 | """ |
161 | | - try: |
162 | | - # we only need to run the gitosis recipe to update `git push` ACLs |
163 | | - return subprocess.check_output(['sudo', 'chef-client', '-o', 'recipe[deis::gitosis]']) |
164 | | - except subprocess.CalledProcessError as err: |
165 | | - print(err) |
166 | | - print(err.output) |
167 | | - raise err |
| 162 | + #try: |
| 163 | + # # we only need to run the gitosis recipe to update `git push` ACLs |
| 164 | + # return subprocess.check_output(['sudo', 'chef-client', '-o', 'recipe[deis::gitosis]']) |
| 165 | + #except subprocess.CalledProcessError as err: |
| 166 | + # print(err) |
| 167 | + # print(err.output) |
| 168 | + # raise err |
| 169 | + pass # TODO: replace this with new key lookup |
168 | 170 |
|
169 | 171 |
|
170 | 172 | def converge_node(node): |
|
0 commit comments