Skip to content

Instantly share code, notes, and snippets.

@mamercad
Created December 12, 2021 19:45
Show Gist options
  • Save mamercad/12765fc36aced945b6c401b1d180d381 to your computer and use it in GitHub Desktop.
Save mamercad/12765fc36aced945b6c401b1d180d381 to your computer and use it in GitHub Desktop.
❯ molecule --debug create
DEBUG Validating schema /Users/mark/Code/github.com/mamercad/molecule-digitalocean/test_role/molecule/default/molecule.yml.
INFO default scenario test matrix: dependency, create, prepare
INFO Performing prerun...
INFO Added ANSIBLE_LIBRARY=/Users/mark/.cache/ansible-compat/ae6233/modules:/Users/mark/.ansible/plugins/modules:/usr/share/ansible/plugins/modules
INFO Added ANSIBLE_COLLECTIONS_PATH=/Users/mark/.cache/ansible-compat/ae6233/collections:/Users/mark/.ansible/collections:/usr/share/ansible/collections
INFO Added ANSIBLE_ROLES_PATH=/Users/mark/.cache/ansible-compat/ae6233/roles:/Users/mark/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles
INFO Using /Users/mark/.ansible/roles/foo.test_role symlink to current repository in order to enable Ansible to find the role using its expected full name.
INFO Running default > dependency
WARNING Skipping, missing the requirements file.
WARNING Skipping, missing the requirements file.
INFO Running default > create
DEBUG: ANSIBLE ENVIRONMENT:
ANSIBLE_COLLECTIONS_PATH: /Users/mark/.cache/ansible-compat/ae6233/collections:/Users/mark/.ansible/collections:/usr/share/ansible/collections
ANSIBLE_CONFIG: /Users/mark/.cache/molecule/test_role/default/ansible.cfg
ANSIBLE_FILTER_PLUGINS: /Users/mark/Code/github.com/mamercad/molecule-digitalocean/venv/lib/python3.9/site-packages/molecule/provisioner/ansible/plugins/filter:/Users/mark/.cache/molecule/test_role/default/plugins/filter:/Users/mark/Code/github.com/mamercad/molecule-digitalocean/test_role/plugins/filter:/Users/mark/.ansible/plugins/filter:/usr/share/ansible/plugins/filter
ANSIBLE_FORCE_COLOR: '1'
ANSIBLE_LIBRARY: /Users/mark/.cache/ansible-compat/ae6233/modules:/Users/mark/.ansible/plugins/modules:/usr/share/ansible/plugins/modules:/Users/mark/Code/github.com/mamercad/molecule-digitalocean/venv/lib/python3.9/site-packages/molecule/provisioner/ansible/plugins/modules:/Users/mark/.cache/molecule/test_role/default/library:/Users/mark/Code/github.com/mamercad/molecule-digitalocean/test_role/library:/Users/mark/.ansible/plugins/modules:/usr/share/ansible/plugins/modules
ANSIBLE_ROLES_PATH: /Users/mark/.cache/molecule/test_role/default/roles:/Users/mark/Code/github.com/mamercad/molecule-digitalocean:/Users/mark/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/Users/mark/.cache/ansible-compat/ae6233/roles:/Users/mark/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles
DEBUG: MOLECULE ENVIRONMENT:
MOLECULE_DEBUG: 'True'
MOLECULE_DEPENDENCY_NAME: galaxy
MOLECULE_DRIVER_NAME: digitalocean
MOLECULE_ENV_FILE: /Users/mark/Code/github.com/mamercad/molecule-digitalocean/test_role/.env.yml
MOLECULE_EPHEMERAL_DIRECTORY: /Users/mark/.cache/molecule/test_role/default
MOLECULE_FILE: /Users/mark/.cache/molecule/test_role/default/molecule.yml
MOLECULE_INSTANCE_CONFIG: /Users/mark/.cache/molecule/test_role/default/instance_config.yml
MOLECULE_INVENTORY_FILE: /Users/mark/.cache/molecule/test_role/default/inventory/ansible_inventory.yml
MOLECULE_PROJECT_DIRECTORY: /Users/mark/Code/github.com/mamercad/molecule-digitalocean/test_role
MOLECULE_PROVISIONER_NAME: ansible
MOLECULE_SCENARIO_DIRECTORY: /Users/mark/Code/github.com/mamercad/molecule-digitalocean/test_role/molecule/default
MOLECULE_SCENARIO_NAME: default
MOLECULE_STATE_FILE: /Users/mark/.cache/molecule/test_role/default/state.yml
MOLECULE_VERIFIER_NAME: ansible
MOLECULE_VERIFIER_TEST_DIRECTORY: /Users/mark/Code/github.com/mamercad/molecule-digitalocean/test_role/molecule/default/tests
DEBUG: SHELL REPLAY:
ANSIBLE_COLLECTIONS_PATH=/Users/mark/.cache/ansible-compat/ae6233/collections:/Users/mark/.ansible/collections:/usr/share/ansible/collections ANSIBLE_CONFIG=/Users/mark/.cache/molecule/test_role/default/ansible.cfg ANSIBLE_FILTER_PLUGINS=/Users/mark/Code/github.com/mamercad/molecule-digitalocean/venv/lib/python3.9/site-packages/molecule/provisioner/ansible/plugins/filter:/Users/mark/.cache/molecule/test_role/default/plugins/filter:/Users/mark/Code/github.com/mamercad/molecule-digitalocean/test_role/plugins/filter:/Users/mark/.ansible/plugins/filter:/usr/share/ansible/plugins/filter ANSIBLE_FORCE_COLOR=1 ANSIBLE_LIBRARY=/Users/mark/.cache/ansible-compat/ae6233/modules:/Users/mark/.ansible/plugins/modules:/usr/share/ansible/plugins/modules:/Users/mark/Code/github.com/mamercad/molecule-digitalocean/venv/lib/python3.9/site-packages/molecule/provisioner/ansible/plugins/modules:/Users/mark/.cache/molecule/test_role/default/library:/Users/mark/Code/github.com/mamercad/molecule-digitalocean/test_role/library:/Users/mark/.ansible/plugins/modules:/usr/share/ansible/plugins/modules ANSIBLE_ROLES_PATH=/Users/mark/.cache/molecule/test_role/default/roles:/Users/mark/Code/github.com/mamercad/molecule-digitalocean:/Users/mark/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/Users/mark/.cache/ansible-compat/ae6233/roles:/Users/mark/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles MOLECULE_DEBUG=True MOLECULE_DEPENDENCY_NAME=galaxy MOLECULE_DRIVER_NAME=digitalocean MOLECULE_ENV_FILE=/Users/mark/Code/github.com/mamercad/molecule-digitalocean/test_role/.env.yml MOLECULE_EPHEMERAL_DIRECTORY=/Users/mark/.cache/molecule/test_role/default MOLECULE_FILE=/Users/mark/.cache/molecule/test_role/default/molecule.yml MOLECULE_INSTANCE_CONFIG=/Users/mark/.cache/molecule/test_role/default/instance_config.yml MOLECULE_INVENTORY_FILE=/Users/mark/.cache/molecule/test_role/default/inventory/ansible_inventory.yml MOLECULE_PROJECT_DIRECTORY=/Users/mark/Code/github.com/mamercad/molecule-digitalocean/test_role MOLECULE_PROVISIONER_NAME=ansible MOLECULE_SCENARIO_DIRECTORY=/Users/mark/Code/github.com/mamercad/molecule-digitalocean/test_role/molecule/default MOLECULE_SCENARIO_NAME=default MOLECULE_STATE_FILE=/Users/mark/.cache/molecule/test_role/default/state.yml MOLECULE_VERIFIER_NAME=ansible MOLECULE_VERIFIER_TEST_DIRECTORY=/Users/mark/Code/github.com/mamercad/molecule-digitalocean/test_role/molecule/default/tests
COMMAND: ansible-playbook --diff --inventory /Users/mark/.cache/molecule/test_role/default/inventory --skip-tags molecule-notest,notest /Users/mark/Code/github.com/mamercad/molecule-digitalocean/venv/lib/python3.9/site-packages/molecule_digitalocean-0.1.dev9+g9f704d5.d20211212-py3.9.egg/molecule_digitalocean/playbooks/create.yml
PLAY [Create] ******************************************************************
TASK [Assert that mandatory variables are defined] *****************************
ok: [localhost] => (item={'image': 'ubuntu-20-04-x64', 'name': 'instance', 'region': 'nyc3', 'size': 's-1vcpu-1gb'}) => {
"ansible_loop_var": "item",
"changed": false,
"item": {
"image": "ubuntu-20-04-x64",
"name": "instance",
"region": "nyc3",
"size": "s-1vcpu-1gb"
},
"msg": "All assertions passed"
}
TASK [Create local keypair] ****************************************************
changed: [localhost]
TASK [Create remote keypair] ***************************************************
changed: [localhost]
TASK [Create molecule instance(s)] *********************************************
changed: [localhost] => (item={'image': 'ubuntu-20-04-x64', 'name': 'instance', 'region': 'nyc3', 'size': 's-1vcpu-1gb'})
TASK [Wait for instance(s) creation to complete] *******************************
FAILED - RETRYING: Wait for instance(s) creation to complete (300 retries left).
FAILED - RETRYING: Wait for instance(s) creation to complete (299 retries left).
FAILED - RETRYING: Wait for instance(s) creation to complete (298 retries left).
FAILED - RETRYING: Wait for instance(s) creation to complete (297 retries left).
FAILED - RETRYING: Wait for instance(s) creation to complete (296 retries left).
FAILED - RETRYING: Wait for instance(s) creation to complete (295 retries left).
FAILED - RETRYING: Wait for instance(s) creation to complete (294 retries left).
FAILED - RETRYING: Wait for instance(s) creation to complete (293 retries left).
FAILED - RETRYING: Wait for instance(s) creation to complete (292 retries left).
FAILED - RETRYING: Wait for instance(s) creation to complete (291 retries left).
FAILED - RETRYING: Wait for instance(s) creation to complete (290 retries left).
changed: [localhost] => (item={'started': 1, 'finished': 0, 'ansible_job_id': '836388730051.4927', 'results_file': '/Users/mark/.ansible_async/836388730051.4927', 'changed': True, 'failed': False, 'item': {'image': 'ubuntu-20-04-x64', 'name': 'instance', 'region': 'nyc3', 'size': 's-1vcpu-1gb'}, 'ansible_loop_var': 'item'})
TASK [Populate instance config dict] *******************************************
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'ip_address'\n\nThe error appears to be in '/Users/mark/Code/github.com/mamercad/molecule-digitalocean/venv/lib/python3.9/site-packages/molecule_digitalocean-0.1.dev9+g9f704d5.d20211212-py3.9.egg/molecule_digitalocean/playbooks/create.yml': line 78, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Populate instance config dict\n ^ here\n"}
PLAY RECAP *********************************************************************
localhost : ok=5 changed=4 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
CRITICAL Ansible return code was 2, command was: ['ansible-playbook', '--diff', '--inventory', '/Users/mark/.cache/molecule/test_role/default/inventory', '--skip-tags', 'molecule-notest,notest', '/Users/mark/Code/github.com/mamercad/molecule-digitalocean/venv/lib/python3.9/site-packages/molecule_digitalocean-0.1.dev9+g9f704d5.d20211212-py3.9.egg/molecule_digitalocean/playbooks/create.yml']
❯ doctl compute ssh-key list
ID Name FingerPrint
32639039 molecule_key db:a7:49:b8:6f:3a:41:f3:b1:44:fe:c1:2c:06:59:f7
❯ doctl compute droplet list
ID Name Public IPv4 Private IPv4 Public IPv6 Memory VCPUs Disk Region Image VPC UUID Status Tags Features Volumes
277587375 instance 45.55.32.192 10.108.0.2 1024 1 25 nyc3 Ubuntu 20.04 (LTS) x64 30f86d25-414e-434f-852d-993ed8d6815e active droplet_agent,private_networking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment