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

ansible 2.3 #2

Closed
wants to merge 6 commits into from
Closed

ansible 2.3 #2

wants to merge 6 commits into from

Conversation

atarkowska
Copy link
Member

@atarkowska atarkowska commented May 3, 2017

install ansible 2.3

to test use:

- name: openmicroscopy.devspace
  src: https://github.com/aleksandra-tarkowska/ansible-role-devspace.git
  version: ansible22

docker compose should work on vm without any additional upgrades

@atarkowska atarkowska changed the title ansible 2.2+ ansible 2.2 May 3, 2017
@atarkowska atarkowska changed the title ansible 2.2 ansible 2.3 May 4, 2017
@joshmoore
Copy link
Member

@aleksandra-tarkowska says there's a(n idempotency?) problem with the git module: a first run of the playbook fails, but later runs pass.

@joshmoore
Copy link
Member

See https://github.com/openmicroscopy/ansible-role-devspace/pull/2/files#diff-2444ad0870f91f17ca6c2a5e96b26823R66

+# TASK [openmicroscopy.ci-devspace : Devspace stop] **********************************************************************************
 +# fatal: [a20ea3a7-7d96-4db1-aed3-c4f9de103313]: FAILED! => {"changed": false, "failed": true, "msg": "Error connecting: Error while fetching server API version: ('Connection aborted.', error(13, 'Permission denied'))"}
 +- name: Devspace stop

Copy link
Member

@manics manics left a comment

Choose a reason for hiding this comment

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

Changed devspaceci_homedevspace_home

Ran into this Ansible 2.3 bug: ansible/ansible#23607 but since all docker containers are started re-running allows the remainder of the playbook to run:
playbook.yml:

- hosts: all
  roles:
    - role: openmicroscopy.docker
      docker_use_ipv4_nic_mtu: True
    - role: openmicroscopy.devspace

requirements.yml:

---
- src: openmicroscopy.docker
- src: openmicroscopy.versioncontrol-utils

Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = "centos/7"
  config.vm.provider "virtualbox" do |vb|
    vb.customize ["modifyvm", :id, "--memory", "2048"]
  end

  config.vm.provision "ansible" do |ansible|
    ansible.playbook = "playbook.yml"
    ansible.raw_arguments = ["--diff"]
    ansible.galaxy_role_file = "requirements.yml"
  end
end

tasks/main.yml Outdated
become: yes
become_user: "{{ devspace_user }}"
docker_service:
project_src: "{{ devspaceci_home }}"
Copy link
Member

Choose a reason for hiding this comment

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

Is devspaceci_home different from devspace_home?

- name: known_hosts
become: yes
become_user: "{{ devspace_user }}"
shell: ssh-keyscan github.com >> {{ devspace_home }}/slave/.ssh/known_hosts
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't ssh-keyscan github.com always give the same output? Can you hard-code it as a file instead so it's idempotent?

become_user: "{{ devspace_user }}"
command: "{{ devspace_home }}/rename.py {{ devspace_omero_branch }}"
args:
chdir: "{{ devspace_home }}"
Copy link
Member

Choose a reason for hiding this comment

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

This isn't idempotent.

@manics
Copy link
Member

manics commented May 30, 2017

Discussed with @aleksandra-tarkowska: the other issues were already present so shouldn't be a blocker for this PR. I've added an issue #3

@jburel
Copy link
Member

jburel commented Oct 28, 2017

This PR has been approved
I tested it again in the context of the training. It works fine
and importantly the version of docker-py installed allows to check the dynamically port assigned by ome/devspace#74

I have tested my change on top of this PR, and tested the full training workflow.

If there is no objections, I would like to merge this PR (approved) and open another one on top to include the change required for the removal of the snoopy key as discussed for the training.
@joshmoore @sbesson

@joshmoore
Copy link
Member

Based on @manics comment, no objections to merging this, but:

  • is it in a releasable state?
  • if so, what would the tag be? 0.2.0?
  • if not, what other PRs are needed?

@jburel
Copy link
Member

jburel commented Oct 30, 2017

We will minimally need a PR to change the key name and the path before tagging i.e. ref to snoopy key and the path i.e. changes in #5

@jburel
Copy link
Member

jburel commented Oct 30, 2017

Testing set up

using an example playbook to provision devspace

---
# Exampe Playbook for provisioning Devspace

- hosts: devspace

  vars:
    # Overrides the default value in the docker role
    docker_use_ipv4_nic_mtu: True

  vars_prompt:
    - name: "devspace_jenkins_password"
      prompt: "Secure Jenkins with admin password (username: devspace)"
      private: yes

  pre_tasks:

    - fail:
        msg: "Jenkins admin password is required"
      when: devspace_jenkins_password is undefined or not devspace_jenkins_password

  roles:
    - role: openmicroscopy.devspace
      # Path to SSH and Git configuration files
      snoopy_dir_path: "/Users/jmarie/Documents/git-repo/omero-sysadmin/snoopy"
      devspace_omero_branch: develop
      devspace_git_repo: https://github.com/openmicroscopy/devspace.git
      devspace_git_repo_version: "0.5.2"
      # force a clean
      devspace_git_update: yes
      devspace_git_force: yes

The playbook needs to be run twice in order to deploy the devspace
see https://10.0.51.143:8443/

@jburel
Copy link
Member

jburel commented Oct 30, 2017

Failure the first time the example playbook is run


fatal: [10.0.51.143]: FAILED! => {
    "changed": false, 
    "failed": true, 
    "module_stderr": "Shared connection to 10.0.51.143 closed.\r\n", 
    "module_stdout": "\r\r\n\u0007Message from syslogd@devspace-training-key at Oct 30 10:43:04 ...\r\r\n kernel:unregister_netdevice: waiting for lo to become free. Usage count = 1\r\n\r\r\r\n\u0007Message from syslogd@devspace-training-key at Oct 30 10:43:14 ...\r\r\n kernel:unregister_netdevice: waiting for lo to become free. Usage count = 1\r\n\r\r\r\n\u0007Message from syslogd@devspace-training-key at Oct 30 10:43:53 ...\r\r\n kernel:unregister_netdevice: waiting for lo to become free. Usage count = 0\r\n\rTraceback (most recent call last):\r\n  File \"/tmp/ansible_pynKze/ansible_module_docker_service.py\", line 1016, in <module>\r\n    main()\r\n  File \"/tmp/ansible_pynKze/ansible_module_docker_service.py\", line 1011, in main\r\n    result = ContainerManager(client).exec_module()\r\n  File \"/tmp/ansible_pynKze/ansible_module_docker_service.py\", line 608, in exec_module\r\n    result = self.cmd_up()\r\n  File \"/tmp/ansible_pynKze/ansible_module_docker_service.py\", line 703, in cmd_up\r\n    get_stdout(fd_name)\r\n  File \"/tmp/ansible_pynKze/ansible_module_docker_service.py\", line 512, in get_stdout\r\n    new_line = re.sub(r'\\x1b\\[.+m', '', line.encode('ascii'))\r\nUnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 20: ordinal not in range(128)\r\n", 
    "msg": "MODULE FAILURE", 
    "rc": 1
}

PLAY RECAP ****************************************************************************************************************************************************************************
10.0.51.143                : ok=26   changed=4    unreachable=0    failed=1  

@jburel
Copy link
Member

jburel commented Nov 1, 2017

I think I have found an issue with this PR
I am currently doing further tests. Do not merge

@jburel
Copy link
Member

jburel commented Nov 1, 2017

I had to re-introduce a step 8ffd104
so the files have the correct owner otherwise none of the jobs will run when deploying the devspace in openstack.

@jburel
Copy link
Member

jburel commented Nov 1, 2017

The failure described above #2 (comment) is due to the version of ansible used
I bumped to 2.4 and there is no error

@jburel
Copy link
Member

jburel commented Nov 2, 2017

Closing this PR replaced by #5

@jburel jburel closed this Nov 2, 2017
@manics
Copy link
Member

manics commented Nov 2, 2017

I've been testing ansible 2.4 with no obvious issues so far, so we could consider upgrading across the OME if you want.

@jburel
Copy link
Member

jburel commented Nov 2, 2017

devspace is now "self-contained"
i.e. no longer use the playbooks from infrastructure to create and provision the devspace in openstack.
ome/devspace#81
and it will used ansible 2.4.
As discussed in the office, I will cap it at 2.4.1 to avoid side-effect

@jburel
Copy link
Member

jburel commented Nov 2, 2017

saying that I started again with a "fresh" instance, The playbook runs correctly but
if I run it once, I have
ERROR: No container found for nginxjenkins_1
I have to run it twice to get everything up....

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