Skip to content

Commit

Permalink
[CE-280] remove docker.io install
Browse files Browse the repository at this point in the history
Currently docker.io is installed which is quite old,
ansible agent has been changed to install docker.ce, the
cloud-init data file needs to be modified to reflect that
change.

Also we need to add functions to allow login to the docker
repository when the repository requires login.

Change-Id: I5e7eb2bcd40742b2988ab7f016eccfbdfe946532
Signed-off-by: tongliofcary <[email protected]>
  • Loading branch information
tongliofcary committed Feb 27, 2018
1 parent 6553ea5 commit 17fe0fa
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/agent/ansible/roles/cloud_aws/prepare/tasks/apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@
sg_id: "{{ vpcsg.security_groups[0].group_id }}"
ami_id: "{{ (found_amis.results | first).ami_id }}"
groups: "prohosts"
with_sequence: count={{ cluster.stack_size }} format=%03x
with_sequence: count={{ cluster.stack_size }} format=%03d
no_log: True
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
name: "{{ cluster.name_prefix }}{{ item }}"
ansible_host: "127.0.0.1"
groups: "prohosts"
with_sequence: count={{ cluster.stack_size }} format=%03x
with_sequence: count={{ cluster.stack_size }} format=%03d
no_log: True
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
name: "{{ cluster.name_prefix }}{{ item }}"
ansible_host: "127.0.0.1"
groups: prohosts
with_sequence: count={{ cluster.stack_size }} format=%03x
with_sequence: count={{ cluster.stack_size }} format=%03d
- name: Scan the public key for master and added it to known hosts
debug: "arggg {{ item }} "
with_items: "{{ groups['prohosts'] }}"
2 changes: 1 addition & 1 deletion src/agent/ansible/roles/cloud_os/prepare/tasks/apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@
name: "{{ cluster.name_prefix }}{{ item }}"
ansible_host: "127.0.0.1"
groups: "prohosts"
with_sequence: count={{ cluster.stack_size }} format=%03x
with_sequence: count={{ cluster.stack_size }} format=%03d
no_log: True

2 changes: 1 addition & 1 deletion src/agent/ansible/roles/cloud_os/prepare/tasks/destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
name: "{{ cluster.name_prefix }}{{ item }}"
ansible_host: "127.0.0.1"
groups: "prohosts"
with_sequence: count={{ cluster.stack_size }} format=%03x
with_sequence: count={{ cluster.stack_size }} format=%03d
no_log: True
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ hostname: {{ inventory_hostname }}.
package_update: true
packages:
- python
- docker.io
4 changes: 2 additions & 2 deletions src/agent/ansible/roles/cloud_vb/prepare/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
sshport: "{{ initial_port | int + item | int }}"
name: "{{ cluster.name_prefix }}{{ item }}"
groups: "prohosts"
with_sequence: count={{ cluster.stack_size }} format=%03x
with_sequence: count={{ cluster.stack_size }} format=%03d

- name: Add netprocessing host group
add_host:
Expand All @@ -22,5 +22,5 @@
ansible_ssh_pass: "{{ cluster.ssh_pass }}"
name: "AA_{{ cluster.name_prefix }}{{ item }}"
groups: "nathosts"
with_sequence: count={{ cluster.stack_size }} format=%03x
with_sequence: count={{ cluster.stack_size }} format=%03d
when: mode == "apply"
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,13 @@
set_fact:
orgmembers: "{{ peers | map(attribute='org') | list | unique | sort | join(\".member' '\") | trim | replace(' ', ',') }}"

- name: Login to docker repo
command: docker login "{{ fabric.repo.url }} -u {{ fabric.repo.username }} -p {{ fabric.repo.password }}"
when: >
fabric.baseimage_tag | length > 0 and
fabric.repo.username | default("") | length > 0 and
fabric.repo.password | default("") | length > 0
- name: Pull necessary container images from the docker hub
command: "docker pull {{ fabric.repo.url }}{{ item.name }}"
when: item.flag | length > 0 and fabric.baseimage_tag | length > 0
Expand Down
4 changes: 3 additions & 1 deletion src/agent/ansible/vars/bc1st.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ fabric: {
# official hub - url: "hyperledger/",
# fabric build hub - url: "nexus3.hyperledger.org:10001/hyperledger/",
url: "hyperledger/",
username: "",
password: "",

# locations to download fabric binaries. This url should point to a
# compressed such as tar or zip file which contains necessary binaries
# such as configtxgen, configtxlator, cryptogen etc.
bin: "https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric-build/linux-amd64-ff6f6dbffed57efb9f7d8886b4a47949ce2d4396/hyperledger-fabric-build-linux-amd64-ff6f6dbffed57efb9f7d8886b4a47949ce2d4396.tar.gz"
bin: ""
}
}

0 comments on commit 17fe0fa

Please sign in to comment.