Open rifaterdemsahin opened 6 years ago
Our YML File for Ansible http://docs.ansible.com/ansible/latest/guide_gce.html
name: Create instance(s) hosts: localhost connection: local gather_facts: no
vars: service_account_email: aif-318@developer.gserviceaccount.com credentials_file: /project.json project_id: adaptiveintelligenceframework machine_type: n1-standard-1 image: debian-7
tasks:
name: Launch instances gce: instance_names: dev machine_type: "{{ machine_type }}" image: "{{ image }}" service_account_email: "{{ service_account_email }}" credentials_file: "{{ credentials_file }}" project_id: "{{ project_id }}
added to here
Created keys folder to place the google Json
/Users/rifaterdemsahin/keys/adaptiveintelligenceframework-f0833ece51c8.json
Note that when using the inventory script gce.py, you also need to populate the gce.ini file that you can find in the contrib/inventory directory of the ansible checkout.
under git repo on mac double ansible
we have the google library now
starters
no change after path setting
Started to get meaning full errors
Erdems-MacBook-Pro:inventory rifaterdemsahin$ ./gce.py --list
Traceback (most recent call last):
File "./gce.py", line 508, in
export PYTHONPATH=/Library/Python/2.7/site-packages/
Erdems-MacBook-Pro:lib rifaterdemsahin$ ansible --version ansible 2.4.3.0 config file = None configured module search path = [u'/Users/rifaterdemsahin/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /Library/Python/2.7/site-packages/ansible executable location = /usr/local/bin/ansible python version = 2.7.10 (default, Jul 15 2017, 17:16:57) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]
now under site-packages and path reset
error changed to datacenter
after empty datacenter
Traceback (most recent call last):
File "./gce.py", line 508, in
Erdems-MacBook-Pro:inventory rifaterdemsahin$ sudo pip install pycrypto Password: The directory '/Users/rifaterdemsahin/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/Users/rifaterdemsahin/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Collecting pycrypto Downloading pycrypto-2.6.1.tar.gz (446kB) 100% |████████████████████████████████| 450kB 1.1MB/s Installing collected packages: pycrypto Running setup.py install for pycrypto ... done Successfully installed pycrypto-2.6.1 Erdems-MacBook-Pro:inventory rifaterdemsahin$
Erdems-MacBook-Pro:inventory rifaterdemsahin$ ./gce.py --list
Traceback (most recent call last):
File "./gce.py", line 508, in
Last login: Wed Mar 7 18:39:27 on ttys001 Erdems-MBP:~ rifaterdemsahin$ cd /Library/Python/2.7/site-packages/ Erdems-MBP:site-packages rifaterdemsahin$ sudo nano secrets.py Password: Erdems-MBP:site-packages rifaterdemsahin$ more secrets.py GCE_PARAMS = ('aif-318@project.googleusercontent.com', '/Users/rifaterdemsahin/keys/adaptiveintelligenceframework-f0833ece51c8.json') GCE_KEYWORD_PARAMS = {'project': 'adaptiveintelligenceframework', 'datacenter': ''}
maybe datacenter ?
setting defaults here
europe-west1
updated version secrets.py
GCE_PARAMS = ('aif-318@project.googleusercontent.com', '/Users/rifaterdemsahin/keys/adaptiveintelligenceframework-f0833ece51c8.json') GCE_KEYWORD_PARAMS = {'project': 'adaptiveintelligenceframework', 'datacenter': 'europe-west1'}
same error
Erdems-MacBook-Pro:inventory rifaterdemsahin$ ./gce.py --list
Traceback (most recent call last):
File "./gce.py", line 508, in
Could you look at the files in the ansible/inventory/gce/hosts/ folder? There should be project.json and secrets.py, check if they seem correct, maybe post them here, but without any sensitive data (emails, keys, ids..). Also try to run ./ansible/inventory/gce/hosts/gce.py and see if it prints any error. And please post the output of the timedatectl command.
export GCE_CREDENTIALS_FILE_PATH=/Users/rifaterdemsahin/keys/adaptiveintelligenceframework-f0833ece51c8.json
set et
Erdems-MacBook-Pro:inventory rifaterdemsahin$ export GCE_CREDENTIALS_FILE_PATH=/Users/rifaterdemsahin/keys/adaptiveintelligenceframework-f0833ece51c8.json
Erdems-MacBook-Pro:inventory rifaterdemsahin$
Erdems-MacBook-Pro:inventory rifaterdemsahin$ ./gce.py --list
Traceback (most recent call last):
File "./gce.py", line 508, in