summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-interface.yml
blob: 05c30da0a66c0aaf8f889181e1192410150be3b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
##############################################################################
# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
---
#- hosts: all
#  sudo: yes
#  tasks:
- name: get last ip address
  shell: expr substr `cat /etc/hostname` 5 1 
  register: lastip

#- name: "configure interface"
##  sudo: True
#  lineinfile:
#    dest: "/etc/network/interfaces"
#    line: "{{ item }}"
#  with_items:
#    - "auto {{ contrail_vhost_device }}"
#    - "iface {{ contrail_vhost_device }} inet static"
#    - "\taddress {{ contrail_vhost_address }}{{ lastip.stdout_lines[0] }}"
#    - "\tnetmask {{ contrail_vhost_netmask }}"

- name: "set interface address"
#  sudo: True
  shell: "ifconfig {{ contrail_vhost_device }} {{ contrail_vhost_address }}{{ lastip.stdout_lines[0] }} netmask {{ contrail_vhost_netmask }}"

- name: "up interface"
#  sudo: True
  shell: "ifconfig {{ contrail_vhost_device }} up"