summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml
blob: d8b82c73e653fd97df58b6bd5cb3d04fef8e52f0 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126

@media only all and (prefers-color-scheme: dark) {
.highlight .hll { background-color: #49483e }
.highlight .c { color: #75715e } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #66d9ef } /* Keyword */
.highlight .l { color: #ae81ff } /* Literal */
.highlight .n { color: #f8f8f2 } /* Name */
.highlight .o { color: #f92672 } /* Operator */
.highlight .p { color: #f8f8f2 } /* Punctuation */
.highlight .ch { color: #75715e } /* Comment.Hashbang */
.highlight .cm { color: #75715e } /* Comment.Multiline */
.highlight .cp { color: #75715e } /* Comment.Preproc */
.highlight .cpf { color: #75715e } /* Comment.PreprocFile */
.highlight .c1 { color: #75715e } /* Comment.Single */
.highlight .cs { color: #75715e } /* Comment.Special */
.highlight .gd { color: #f92672 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gi { color: #a6e22e } /* Generic.Inserted */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #75715e } /* Generic.Subheading */
.highlight .kc { color: #66d9ef } /* Keyword.Constant */
.highlight .kd { color: #66d9ef } /* Keyword.Declaration */
.highlight .kn { color: #f92672 } /* Keyword.Namespace */
.highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
.highlight .kr { color: #66d9ef } /* Keyword.Reserved */
.highlight .kt { color: #66d9ef } /* Keyword.Type */
.highlight .ld { color: #e6db74 } /* Literal.Date */
.highlight .m { color: #ae81ff } /* Literal.Number */
.highlight .s { color: #e6db74 } /* Literal.String */
.highlight .na { color: #a6e22e } /* Name.Attribute */
.highlight .nb { color: #f8f8f2 } /* Name.Builtin */
.highlight .nc { color: #a6e22e } /* Name.Class */
.highlight .no { color: #66d9ef } /* Name.Constant */
.highlight .nd { color: #a6e22e } /* Name.Decorator */
.highlight .ni { color: #f8f8f2 } /* Name.Entity */
.highlight .ne { color: #a6e22e } /* Name.Exception */
.highlight .nf { color: #a6e22e } /* Name.Function */
.highlight .nl { color: #f8f8f2 } /* Name.Label */
.highlight .nn { color: #f8f8f2 } /* Name.Namespace */
.highlight .nx { color: #a6e22e } /* Name.Other */
.highlight .py { color: #f8f8f2 } /* Name.Property */
.highlight .nt { color: #f92672 } /* Name.Tag */
.highlight .nv { color: #f8f8f2 } /* Name.Variable */
.highlight .ow { color: #f92672 } /* Operator.Word */
.highlight .w { color: #f8f8f2 } /* Text.Whitespace */
.highlight .mb { color: #ae81ff } /* Literal.Number.Bin */
.highlight .mf { color: #ae81ff } /* Literal.Number.Float */
.highlight .mh { color: #ae81ff } /* Literal.Number.Hex */
.highlight .mi { color: #ae81ff } /* Literal.Number.Integer */
.highlight .mo { color: #ae81ff } /* Literal.Number.Oct */
.highlight .sa { color: #e6db74 } /* Literal.String.Affix */
.highlight .sb { color: #e6db74 } /* Literal.String.Backtick */
.highlight .sc { color: #e6db74 } /* Literal.String.Char */
.highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */
.highlight .sd { color: #e6db74 } /* Literal.String.Doc */
.highlight .s2 { color: #e6db74 } /* Literal.String.Double */
.highlight .se { color: #ae81ff } /* Literal.String.Escape */
.highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */
.highlight .si { color: #e6db74 } /* Literal.String.Interpol */
.highlight .sx { color: #e6db74 } /* Literal.String.Other */
.highlight .sr { color: #e6db74 } /* Literal.String.Regex */
.highlight .s1 { color: #e6db74 } /* Literal.String.Single */
.highlight .ss { color: #e6db74 } /* Literal.String.Symbol */
.highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #a6e22e } /* Name.Function.Magic */
.highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */
.highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */
.highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */
.highlight .vm
---
- hosts: all
  remote_user: root
  pre_tasks:
    - name: make sure ssh dir exist
      file:
        path: '{{ item.path }}'
        owner: '{{ item.owner }}'
        group: '{{ item.group }}'
        state: directory
        mode: 0755
      with_items:
        - path: /root/.ssh
          owner: root
          group: root

    - name: write ssh config
      copy:
        content: "UserKnownHostsFile /dev/null\nStrictHostKeyChecking no"
        dest: '{{ item.dest }}'
        owner: '{{ item.owner }}'
        group: '{{ item.group }}'
        mode: 0600
      with_items:
        - dest: /root/.ssh/config
          owner: root
          group: root

    - name: generate ssh keys
      shell: if [ ! -f ~/.ssh/id_rsa.pub ]; then ssh-keygen -q -t rsa -f ~/.ssh/id_rsa -N ""; else echo "already gen ssh key!"; fi;

    - name: fetch ssh keys
      fetch: src=/root/.ssh/id_rsa.pub dest=/tmp/ssh-keys-{{ ansible_hostname }} flat=yes

    - authorized_key:
        user: root
        key:  "{{ lookup('file', 'item') }}"
      with_fileglob:
        - /tmp/ssh-keys-*
  max_fail_percentage: 0
  roles:
    - common

- hosts: all
  remote_user: root
  accelerate: true
  max_fail_percentage: 0
  roles:
    - setup-network

- hosts: ha
  remote_user: root
  accelerate: true
  max_fail_percentage: 0
  roles:
    - ha

- hosts: controller
  remote_user: root
  accelerate: true
  max_fail_percentage: 0
  roles:
    - memcached
    - apache
    - database
    - mq
    - keystone
    - nova-controller
    - neutron-controller
    - cinder-controller
    - glance
    - neutron-common
    - neutron-network
    - ceilometer_controller
#    - ext-network
    - dashboard
    - heat
#    - aodh

- hosts: all
  remote_user: root
  accelerate: true
  max_fail_percentage: 0
  roles:
    - storage

- hosts: compute
  remote_user: root
  accelerate: true
  max_fail_percentage: 0
  roles:
    - nova-compute
    - neutron-compute
    - cinder-volume
    - ceilometer_compute

- hosts: all
  remote_user: root
  accelerate: true
  max_fail_percentage: 0
  roles:
    - secgroup

- hosts: ceph_adm
  remote_user: root
  accelerate: true
  max_fail_percentage: 0
  roles: []
  #  - ceph-deploy

- hosts: ceph
  remote_user: root
  accelerate: true
  max_fail_percentage: 0
  roles:
    - ceph-purge
    - ceph-config

- hosts: ceph_mon
  remote_user: root
  accelerate: true
  max_fail_percentage: 0
  roles:
    - ceph-mon

- hosts: ceph_osd
  remote_user: root
  accelerate: true
  max_fail_percentage: 0
  roles:
    - ceph-osd

- hosts: ceph
  remote_user: root
  accelerate: true
  max_fail_percentage: 0
  roles:
    - ceph-openstack

- hosts: all
  remote_user: root
  accelerate: true
  max_fail_percentage: 0
  roles:
    - monitor


- hosts: all
  remote_user: root
  accelerate: true
  max_fail_percentage: 0
  tasks:
    - name: set bash to nova
      user:
         name: nova
         shell: /bin/bash

    - name: make sure ssh dir exist
      file:
        path: '{{ item.path }}'
        owner: '{{ item.owner }}'
        group: '{{ item.group }}'
        state: directory
        mode: 0755
      with_items:
        - path: /var/lib/nova/.ssh
          owner: nova
          group: nova

    - name: copy ssh keys for nova
      shell: cp -rf /root/.ssh/id_rsa /var/lib/nova/.ssh;

    - name: write ssh config
      copy:
        content: "UserKnownHostsFile /dev/null\nStrictHostKeyChecking no"
        dest: '{{ item.dest }}'
        owner: '{{ item.owner }}'
        group: '{{ item.group }}'
        mode: 0600
      with_items:
        - dest: /var/lib/nova/.ssh/config
          owner: nova
          group: nova

    - authorized_key:
        user: nova
        key:  "{{ lookup('file', 'item') }}"
      with_fileglob:
        - /tmp/ssh-keys-*

    - name: chown ssh file
      shell: chown -R nova:nova /var/lib/nova/.ssh;


- hosts: all
  remote_user: root
  max_fail_percentage: 0
  roles:
    - odl_cluster

- hosts: all
  remote_user: root
  accelerate: true
  max_fail_percentage: 0
  roles:
    - onos_cluster

- hosts: all
  remote_user: root
  sudo: True
  max_fail_percentage: 0
  roles:
    - open-contrail

- hosts: all
  remote_user: root
  serial: 1
  max_fail_percentage: 0
  roles:
    - odl_cluster_neutron

- hosts: all
  remote_user: root
  max_fail_percentage: 0
  roles:
    - odl_cluster_post

- hosts: controller
  remote_user: root
  max_fail_percentage: 0
  roles:
    - ext-network

- hosts: controller
  remote_user: root
  accelerate: true
  max_fail_percentage: 0
  roles:
    - tacker