Fix hardcode for ubuntu apt-key

patch2: make ansible code follow lint.
patch2: some of the 'shell' command will be replaced
with ansible built-in 'script' in a separate CL.
Change-Id: I010fbf89d7393c2ba1bee06dca36196fe5cc7006
This commit is contained in:
Xicheng Chang 2015-04-18 00:09:12 -07:00
parent 996126dfbd
commit 410a9c480d
8 changed files with 55 additions and 28 deletions

View File

@ -40,6 +40,7 @@ EXTERNAL_NETWORK_GATEWAY: 203.0.113.1
FLOATING_IP_START: 203.0.113.101
FLOATING_IP_END: 203.0.113.200
juno_cloud_archive: deb http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/juno main
build_in_image: http://cdn.download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img
build_in_image_name: cirros-0.3.3-x86_64-disk.img

View File

@ -9,7 +9,7 @@
stat: path={{ physical_device }}
register: st
- name: repace physical_device with /dev/loop if st returns false
- name: repace physical_device if st is false
local_action: copy src=loop.yml dest=/tmp/loop.yml
when: st.stat.exists == False
@ -26,7 +26,8 @@
register: partition_size
- name: if not mounted, mount it
shell: dd if=/dev/zero of=/mnt/cinder-volumes bs=1 count=0 seek={{ partition_size.stdout }}
shell: dd if=/dev/zero of=/mnt/cinder-volumes
bs=1 count=0 seek={{ partition_size.stdout }}
when: cindervolumes.stdout != 'cinder-volumes'
- name: get first lo device
@ -39,10 +40,12 @@
when: cindervolumes.stdout != 'cinder-volumes'
- name: create physical and group volumes
lvg: vg=cinder-volumes pvs={{ physical_device }} vg_options=--force
lvg: vg=cinder-volumes pvs={{ physical_device }}
vg_options=--force
- name: upload cinder-volume configuration
template: src=cinder.conf dest=/etc/cinder/cinder.conf backup=yes
template: src=cinder.conf dest=/etc/cinder/cinder.conf
backup=yes
notify:
- restart cinder-volume
- restart tgt

View File

@ -1,9 +1,11 @@
---
- name: add juno cloudarchive
apt_repository: repo='deb http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/juno main' state=present
- name: install ubuntu-cloud-keyring(ubuntu)
apt: name={{ item }} state=latest
with_items:
- ubuntu-cloud-keyring
- name: add juno apt key
apt_key: keyserver=keyserver.ubuntu.com id=5EDB1B62EC4926EA
- name: add juno cloudarchive
apt_repository: repo={{ juno_cloud_archive }} state=present
- name: update packages once
apt: update_cache=yes

View File

@ -19,7 +19,8 @@
# backup=yes
- name: update horizon settings
template: src=local_settings.py dest=/etc/openstack-dashboard/local_settings.py
template: src=local_settings.py
dest=/etc/openstack-dashboard/local_settings.py
backup=yes
- name: restart apache2

View File

@ -12,7 +12,7 @@
notify:
- restart mysql
- name: manually restart mysql server first before creating db models
- name: manually restart mysql server
service: name=mysql
state=restarted

View File

@ -6,7 +6,8 @@
- python-glanceclient
- name: update glance conf
template: src={{ item }} dest=/etc/glance/{{ item }} backup=yes
template: src={{ item }} dest=/etc/glance/{{ item }}
backup=yes
with_items:
- glance-api.conf
- glance-registry.conf

View File

@ -1,13 +1,16 @@
---
- name: activate ipv4 forwarding
sysctl: name=net.ipv4.ip_forward value=1 state=present reload=yes
sysctl: name=net.ipv4.ip_forward value=1
state=present reload=yes
- name: deactivate ipv4 rp filter
sysctl: name=net.ipv4.conf.all.rp_filter value=0 state=present reload=yes
sysctl: name=net.ipv4.conf.all.rp_filter value=0
state=present reload=yes
- name: deactivate ipv4 default rp filter
sysctl: name=net.ipv4.conf.default.rp_filter value=0 state=present reload=yes
sysctl: name=net.ipv4.conf.default.rp_filter
value=0 state=present reload=yes
- name: install compute-related neutron packages
apt: name={{ item }} state=present force=yes
@ -18,16 +21,20 @@
- openvswitch-switch
- name: install neutron openvswitch agent
apt: name=neutron-plugin-openvswitch-agent state=present force=yes
apt: name=neutron-plugin-openvswitch-agent
state=present force=yes
when: "'opendaylight' not in {{ NEUTRON_MECHANISM_DRIVERS }}"
- name: config neutron
template: src=neutron-network.conf dest=/etc/neutron/neutron.conf backup=yes
template: src=neutron-network.conf
dest=/etc/neutron/neutron.conf backup=yes
notify:
- restart neutron-plugin-openvswitch-agent
- name: config ml2 plugin
template: src=ml2_conf.ini dest=/etc/neutron/plugins/ml2/ml2_conf.ini backup=yes
template: src=ml2_conf.ini
dest=/etc/neutron/plugins/ml2/ml2_conf.ini
backup=yes
notify:
- restart neutron-plugin-openvswitch-agent

View File

@ -1,12 +1,15 @@
---
- name: activate ipv4 forwarding
sysctl: name=net.ipv4.ip_forward value=1 state=present reload=yes
sysctl: name=net.ipv4.ip_forward value=1
state=present reload=yes
- name: deactivate ipv4 rp filter
sysctl: name=net.ipv4.conf.all.rp_filter value=0 state=present reload=yes
sysctl: name=net.ipv4.conf.all.rp_filter value=0
state=present reload=yes
- name: deactivate ipv4 default rp filter
sysctl: name=net.ipv4.conf.default.rp_filter value=0 state=present reload=yes
sysctl: name=net.ipv4.conf.default.rp_filter
value=0 state=present reload=yes
- name: install neutron network related packages
apt: name={{ item }} state=present force=yes
@ -18,11 +21,13 @@
- neutron-dhcp-agent
- name: install neutron openvswitch agent
apt: name=neutron-plugin-openvswitch-agent state=present force=yes
apt: name=neutron-plugin-openvswitch-agent
state=present force=yes
when: "'openvswitch' in {{ NEUTRON_MECHANISM_DRIVERS }}"
- name: config neutron
template: src=neutron-network.conf dest=/etc/neutron/neutron.conf backup=yes
template: src=neutron-network.conf
dest=/etc/neutron/neutron.conf backup=yes
notify:
- restart neutron-plugin-openvswitch-agent
- restart neutron-l3-agent
@ -31,29 +36,35 @@
- restart neutron-metadata-agent
- name: config l3 agent
template: src=l3_agent.ini dest=/etc/neutron/l3_agent.ini backup=yes
template: src=l3_agent.ini dest=/etc/neutron/l3_agent.ini
backup=yes
notify:
- restart neutron-l3-agent
- name: config dhcp agent
template: src=dhcp_agent.ini dest=/etc/neutron/dhcp_agent.ini backup=yes
template: src=dhcp_agent.ini dest=/etc/neutron/dhcp_agent.ini
backup=yes
notify:
- kill dnsmasq
- restart neutron-dhcp-agent
- name: update dnsmasq-neutron.conf
template: src=dnsmasq-neutron.conf dest=/etc/neutron/dnsmasq-neutron.conf
template: src=dnsmasq-neutron.conf
dest=/etc/neutron/dnsmasq-neutron.conf
notify:
- kill dnsmasq
- restart neutron-dhcp-agent
- name: config metadata agent
template: src=metadata_agent.ini dest=/etc/neutron/metadata_agent.ini backup=yes
template: src=metadata_agent.ini
dest=/etc/neutron/metadata_agent.ini backup=yes
notify:
- restart neutron-metadata-agent
- name: config ml2 plugin
template: src=ml2_conf.ini dest=/etc/neutron/plugins/ml2/ml2_conf.ini backup=yes
template: src=ml2_conf.ini
dest=/etc/neutron/plugins/ml2/ml2_conf.ini
backup=yes
notify:
- restart neutron-plugin-openvswitch-agent
@ -67,7 +78,8 @@
when: "'openvswitch' in {{ NEUTRON_MECHANISM_DRIVERS }}"
- name: assign a port to br-ex for physical ext interface
openvswitch_port: bridge=br-ex port={{ INTERFACE_NAME }} state=present
openvswitch_port: bridge=br-ex port={{ INTERFACE_NAME }}
state=present
when: "'openvswitch' in {{ NEUTRON_MECHANISM_DRIVERS }}"
- include: igmp-router.yml