Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

cleanup devspace #149

Merged
merged 4 commits into from
Nov 3, 2016
Merged

cleanup devspace #149

merged 4 commits into from
Nov 3, 2016

Conversation

atarkowska
Copy link
Member

@atarkowska atarkowska commented Oct 17, 2016

This PR renams vars and fixed jenkins url to match ip (that value is used by testng)

Test:

with ome/devspace#52

  • default:

    • vars:
    openstack_ip: IP
    omero_branch: develop
    snoopy_dir_path: "/path/to/snoopy"
    
    git_repo: "https://github.com/aleksandra-tarkowska/devspace.git"
    version: "customization"
    
    • run:
    $ ansible-playbook os-devspace.yml -e vm_name=devspace-test -e vm_key_name=your_key
    $ ansible-playbook -l devspace-test -u centos devspace.yml 
    

@snoopycrimecop
Copy link
Member

Conflicting PR. Removed from build MANAGEMENT_TOOLS-merge#1040. See the console output for more details.
Possible conflicts:

  • Upstream changes
    • ansible/roles/devspace/defaults/main.yml

@snoopycrimecop
Copy link
Member

Conflicting PR. Removed from build MANAGEMENT_TOOLS-merge#1041. See the console output for more details.
Possible conflicts:

  • Upstream changes
    • ansible/roles/devspace/defaults/main.yml

@snoopycrimecop
Copy link
Member

Conflicting PR. Removed from build MANAGEMENT_TOOLS-merge#1042. See the console output for more details.
Possible conflicts:

  • Upstream changes
    • ansible/roles/devspace/defaults/main.yml

@snoopycrimecop
Copy link
Member

Conflicting PR. Removed from build MANAGEMENT_TOOLS-merge#1043. See the console output for more details.
Possible conflicts:

  • Upstream changes
    • ansible/roles/devspace/defaults/main.yml

@snoopycrimecop
Copy link
Member

Conflicting PR. Removed from build MANAGEMENT_TOOLS-merge#1044. See the console output for more details.
Possible conflicts:

  • Upstream changes
    • ansible/roles/devspace/defaults/main.yml

@atarkowska atarkowska changed the title playbook compose v2 cleanup devspace Oct 28, 2016
@atarkowska
Copy link
Member Author

atarkowska commented Oct 28, 2016

using vars and ome/devspace#52:

ansible/inventory/group_vars/devspace

devspace_openstack_ip: 10.0.51.106
devspace_omero_branch: develop
snoopy_dir_path: "/my/path/to/snoopy"

devspace_git_repo: "https://github.com/aleksandra-tarkowska/devspace.git"
devspace_git_repo_version: "customization"

deployed on 10.0.51.106

$ ansible-playbook os-devspace.yml -e vm_name=devspace-develop -e vm_key_name=ola
...
TASK [debug] *******************************************************************
ok: [localhost] => {
    "msg": "IPs (Docker) private:192.168.1.61 floating:10.0.51.106"
}

PLAY RECAP *********************************************************************
localhost                  : ok=5    changed=1    unreachable=0    failed=0   
$ ansible-playbook -l devspace-develop -u centos devspace.yml 
statically included: /Users/ola/OMERO/SYSADMIN/management_tools/infrastructure/ansible/roles/devspace/tasks/devspace-install.yml
Enter Jenkins password: 

PLAY [devspace] ****************************************************************

TASK [setup] *******************************************************************
ok: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [upgrade-distpackages : system packages | upgrade] ************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656] => (item=[u'*'])

TASK [upgrade-distpackages : system | current running kernel] ******************
ok: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [upgrade-distpackages : system | latest installed kernel] *****************
ok: [51e0d32f-c66f-4bfc-8275-10c9a713b656]
 [WARNING]: Consider using yum, dnf or zypper module rather than running rpm


TASK [upgrade-distpackages : system | check if reboot needed] ******************
ok: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [upgrade-distpackages : debug] ********************************************
ok: [51e0d32f-c66f-4bfc-8275-10c9a713b656] => {
    "msg": "Reboot needed (kernel): Current:3.10.0-327.22.2.el7.x86_64 Latest:3.10.0-327.36.3.el7.x86_64"
}

TASK [upgrade-distpackages : system | reboot] **********************************
skipping: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [upgrade-distpackages : system | wait for server to reboot] ***************
skipping: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [lvm-partition : storage | create logical volume] *************************
skipping: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [lvm-partition : storage | format] ****************************************
skipping: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [lvm-partition : storage | mount] *****************************************
skipping: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [docker : upstream docker | setup repository] *****************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [docker : upstream docker | install docker] *******************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [docker : storage | setup lvm docker-pool] ********************************
skipping: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [docker : upstream docker | configure docker options] *********************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [docker : upstream docker | copy systemd file] ****************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [docker : upstream docker | reload systemd] *******************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [docker : docker | enable] ************************************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [docker : docker | group members] *****************************************
[DEPRECATION WARNING]: Skipping task due to undefined Error, in the future this will be a fatal error.: 'docker_groupmembers' is 
undefined.
This feature will be removed in a future release. Deprecation warnings can be disabled by setting 
deprecation_warnings=False in ansible.cfg.
skipping: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [versioncontrol-utils : system packages | install epel repo] **************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [versioncontrol-utils : system packages | basic system utils] *************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656] => (item=[u'git'])

TASK [devspace : add user omero to docker group] *******************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [devspace : ensures /home/omero/.ssh dir exists] **************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [devspace : allow omero to ssh directly] **********************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [devspace : install python tools] *****************************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656] => (item=[u'python-devel', u'python-pip'])

TASK [devspace : install python packages] **************************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656] => (item=pip)
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656] => (item=passlib)
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656] => (item=pyyaml)
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656] => (item=docker-compose)

TASK [devspace : TODO install docker-py] ***************************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656] => (item=docker-py==1.9.0)

TASK [devspace : clone devspace] ***********************************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [devspace : ensures .ssh dir exists] **************************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [devspace : copy snoopy] **************************************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656] => (item={u'dest': u'.ssh/config', u'srcfile': u'.ssh/config'})
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656] => (item={u'dest': u'.ssh/snoopycrimecop_github', u'srcfile': u'.ssh/snoopycrimecop_github'})
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656] => (item={u'dest': u'.ssh/snoopycrimecop_github.pub', u'srcfile': u'.ssh/snoopycrimecop_github.pub'})
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656] => (item={u'dest': u'.gitconfig', u'srcfile': u'.gitconfig'})

TASK [devspace : known_hosts] **************************************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [devspace : chmod known_hosts] ********************************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [devspace : change USER_ID] ***********************************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656] => (item=bf/Dockerfile)
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656] => (item=nginx/Dockerfile)
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656] => (item=slave/Dockerfile)
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656] => (item=server/Dockerfile)
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656] => (item=web/Dockerfile)

TASK [devspace : set basic auth password for jenkins] **************************
skipping: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [devspace : set basic auth password for jenkins] **************************
skipping: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [devspace : set jenkins password] *****************************************
skipping: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [devspace : ssl cert for jenkins] *****************************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [devspace : ssl cert for nginx] *******************************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [devspace : rename to develop...] *****************************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

TASK [devspace : fix jenkinsUrl] ***********************************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656] => (item=jenkins.model.JenkinsLocationConfiguration.xml)

RUNNING HANDLER [docker : restart docker] **************************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

RUNNING HANDLER [devspace : restart devspace] **********************************
included: /Users/ola/OMERO/SYSADMIN/management_tools/infrastructure/ansible/roles/devspace/tasks/devspace-runtime.yml for 51e0d32f-c66f-4bfc-8275-10c9a713b656

RUNNING HANDLER [devspace : docker_service] ************************************
ok: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

RUNNING HANDLER [devspace : docker_service] ************************************
changed: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

RUNNING HANDLER [devspace : debug] *********************************************
ok: [51e0d32f-c66f-4bfc-8275-10c9a713b656] => {
...

RUNNING HANDLER [devspace : assert] ********************************************
ok: [51e0d32f-c66f-4bfc-8275-10c9a713b656]

PLAY RECAP *********************************************************************
51e0d32f-c66f-4bfc-8275-10c9a713b656 : ok=36   changed=27   unreachable=0    failed=0   

# devspace branch
version: "0.3.2"
devspace_git_repo_version: "0.3.3"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new tag

@atarkowska
Copy link
Member Author

atarkowska commented Nov 3, 2016

@manics using ansible 2.2 I am getting:

TASK [docker : docker | group members] *****************************************
fatal: [14c59748-9ac9-4314-ab1a-102563a5088c]: FAILED! => {"failed": true, "msg": "'docker_groupmembers' is undefined"}

any thoughts, that was indeed warning in the past?
ignore that, sorted

@atarkowska
Copy link
Member Author

atarkowska commented Nov 3, 2016

DO NOT USE ansible 2.2

looks like many things has changed in ansible 2.2

RUNNING HANDLER [devspace : docker_service] ************************************
ERROR! Unexpected Exception: 'NoneType' object has no attribute 'register'
TASK [devspace : clone devspace] ***********************************************
task path: /Users/ola/OMERO/SYSADMIN/management_tools/infrastructure/ansible/roles/devspace/tasks/devspace-install
...
"module_stdout": "Traceback (most recent call last):\r\n  File \"/tmp/ansible_nwvwSt/ansible_module_git.py\", line 1040, in <module>\r\n    main()\r\n  File \"/tmp/ansible_nwvwSt/ansible_module_git.py\", line 994, in main\r\n    result.update(changed=True, after=remote_head, msg='Local modifications exist')\r\nUnboundLocalError: local variable 'remote_head' referenced before assignment\r\n", 

Need to look at that closer

@manics
Copy link
Member

manics commented Nov 3, 2016

TASK [docker : docker | group members] *****************************************
fatal: [14c59748-9ac9-4314-ab1a-102563a5088c]: FAILED! => {"failed": true, "msg": "'docker_groupmembers' is undefined"}

It's deprecated syntax that has obviously been dropped in 2.2: https://github.com/openmicroscopy/infrastructure/blob/master/ansible/roles/docker/tasks/main.yml#L69
I think that line just needs quotes.

replace: '\1<jenkinsUrl>https://{{ devspace_openstack_ip }}:8443</jenkinsUrl>'
with_items:
- jenkins.model.JenkinsLocationConfiguration.xml
when: devspace_openstack_ip|length>0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note this forces devspace_openstack_ip to be defined. Otherwise, the playbook fails with

TASK [devspace : fix jenkinsUrl] ***********************************************
fatal: [seb-devspace]: FAILED! => {"failed": true, "msg": "The conditional check 'devspace_openstack_ip|length>0' failed. The error was: Unexpected templating type error occurred on ({% if devspace_openstack_ip|length>0 %} True {% else %} False {% endif %}): object of type 'NoneType' has no len()\n\nThe error appears to have been in '/opt/ome/management_tools/infrastructure/ansible/roles/devspace/tasks/devspace-install.yml': line 181, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: fix jenkinsUrl\n  ^ here\n"}

Is there a way to have the conditional being more robust or define a default IP like 0.0.0.0?

Copy link
Member Author

@atarkowska atarkowska Nov 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no ,you can't, that is your jenkins host and jenkins must have that set to the real value. Otherwise testNG results won't show up

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sure default(inventory_hostname) would solve the problem but unfortunately I dont know how to use it

@sbesson
Copy link
Member

sbesson commented Nov 3, 2016

#149 (comment) is not a blocker as the behavior was already there but it might be interesting to use the dynamic inventory to retrieve the IP for simplification in the future. Otherwise, I was able to provision, deploy and run the devspace from the tip of this branch. Merging.

@sbesson sbesson merged commit e0f591f into ome:master Nov 3, 2016
@atarkowska atarkowska deleted the v2 branch November 3, 2016 11:55
@atarkowska
Copy link
Member Author

thx for testing

manics pushed a commit to manics-archive/ome-infrastructure that referenced this pull request Nov 24, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants