Merge "Fix ironic failed"
This commit is contained in:
commit
f9f619d208
@ -19,6 +19,8 @@
|
|||||||
name: "ironic_api"
|
name: "ironic_api"
|
||||||
volumes:
|
volumes:
|
||||||
- "{{ node_config_directory }}/ironic-api/:{{ container_config_directory }}/:ro"
|
- "{{ node_config_directory }}/ironic-api/:{{ container_config_directory }}/:ro"
|
||||||
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
|
- "kolla_logs:/var/log/kolla"
|
||||||
when: inventory_hostname in groups['ironic-api']
|
when: inventory_hostname in groups['ironic-api']
|
||||||
|
|
||||||
- name: Starting ironic-conductor container
|
- name: Starting ironic-conductor container
|
||||||
@ -27,9 +29,15 @@
|
|||||||
common_options: "{{ docker_common_options }}"
|
common_options: "{{ docker_common_options }}"
|
||||||
image: "{{ ironic_conductor_image_full }}"
|
image: "{{ ironic_conductor_image_full }}"
|
||||||
name: "ironic_conductor"
|
name: "ironic_conductor"
|
||||||
|
privileged: True
|
||||||
volumes:
|
volumes:
|
||||||
- "{{ node_config_directory }}/ironic-conductor/:{{ container_config_directory }}/:ro"
|
- "{{ node_config_directory }}/ironic-conductor/:{{ container_config_directory }}/:ro"
|
||||||
- "/etc/localtime:/etc/localtime:ro"
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
|
- "/sys:/sys"
|
||||||
|
- "/dev:/dev"
|
||||||
|
- "/run:/run"
|
||||||
|
- "kolla_logs:/var/log/kolla"
|
||||||
|
- "ironic:/var/lib/ironic"
|
||||||
- "ironic_pxe:/tftpboot/"
|
- "ironic_pxe:/tftpboot/"
|
||||||
when: inventory_hostname in groups['ironic-conductor']
|
when: inventory_hostname in groups['ironic-conductor']
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
debug = {{ ironic_logging_debug }}
|
debug = {{ ironic_logging_debug }}
|
||||||
|
|
||||||
|
log_dir = /var/log/kolla/ironic
|
||||||
|
|
||||||
admin_user = {{ openstack_auth.username }}
|
admin_user = {{ openstack_auth.username }}
|
||||||
admin_password = {{ keystone_admin_password }}
|
admin_password = {{ keystone_admin_password }}
|
||||||
|
|
||||||
@ -16,7 +18,7 @@ host_ip = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['a
|
|||||||
{% if service_name == 'ironic-conductor' %}
|
{% if service_name == 'ironic-conductor' %}
|
||||||
[conductor]
|
[conductor]
|
||||||
api_url = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ ironic_api_port }}
|
api_url = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ ironic_api_port }}
|
||||||
clean_nodes = false
|
automated_clean=false
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if service_name == 'ironic-inspector' %}
|
{% if service_name == 'ironic-inspector' %}
|
||||||
@ -41,9 +43,9 @@ auth_url = {{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_admin_po
|
|||||||
auth_type = password
|
auth_type = password
|
||||||
project_domain_id = default
|
project_domain_id = default
|
||||||
user_domain_id = default
|
user_domain_id = default
|
||||||
admin_tenant_name = service
|
project_name = service
|
||||||
admin_user = {{ ironic_keystone_user }}
|
username = {{ ironic_keystone_user }}
|
||||||
admin_password = {{ ironic_keystone_password }}
|
password = {{ ironic_keystone_password }}
|
||||||
|
|
||||||
memcache_security_strategy = ENCRYPT
|
memcache_security_strategy = ENCRYPT
|
||||||
memcache_secret_key = {{ memcache_secret_key }}
|
memcache_secret_key = {{ memcache_secret_key }}
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
when:
|
when:
|
||||||
- inventory_hostname in groups['compute']
|
- inventory_hostname in groups['compute']
|
||||||
- not enable_nova_fake | bool
|
- not enable_nova_fake | bool
|
||||||
|
- not enable_ironic | bool
|
||||||
|
|
||||||
- name: Starting nova-compute-ironic container
|
- name: Starting nova-compute-ironic container
|
||||||
kolla_docker:
|
kolla_docker:
|
||||||
|
@ -96,6 +96,7 @@ html5proxy_port = {{ nova_spicehtml5proxy_port }}
|
|||||||
username = {{ ironic_keystone_user }}
|
username = {{ ironic_keystone_user }}
|
||||||
password = {{ ironic_keystone_password }}
|
password = {{ ironic_keystone_password }}
|
||||||
auth_url = {{ openstack_auth.auth_url }}/v3
|
auth_url = {{ openstack_auth.auth_url }}/v3
|
||||||
|
auth_type = password
|
||||||
project_name = service
|
project_name = service
|
||||||
user_domain_name = default
|
user_domain_name = default
|
||||||
project_domain_name = default
|
project_domain_name = default
|
||||||
|
@ -16,8 +16,8 @@ MAINTAINER {{ maintainer }}
|
|||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
COPY extend_start.sh /usr/local/bin/kolla_extend_start
|
COPY extend_start.sh /usr/local/bin/kolla_ironic_extend_start
|
||||||
RUN chmod 755 /usr/local/bin/kolla_extend_start
|
RUN chmod 755 /usr/local/bin/kolla_ironic_extend_start
|
||||||
|
|
||||||
{% block ironic_api_footer %}{% endblock %}
|
{% block ironic_api_footer %}{% endblock %}
|
||||||
{% block footer %}{% endblock %}
|
{% block footer %}{% endblock %}
|
||||||
|
@ -18,16 +18,24 @@ MAINTAINER {{ maintainer }}
|
|||||||
|
|
||||||
ADD ironic-base-archive /ironic-base-source
|
ADD ironic-base-archive /ironic-base-source
|
||||||
RUN ln -s ironic-base-source/* ironic \
|
RUN ln -s ironic-base-source/* ironic \
|
||||||
&& useradd --user-group ironic \
|
&& useradd --user-group --create-home --home-dir /var/lib/ironic ironic \
|
||||||
&& /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /ironic \
|
&& /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /ironic \
|
||||||
&& mkdir -p /etc/ironic /var/log/ironic /home/ironic \
|
&& mkdir -p /etc/ironic /var/lib/ironic \
|
||||||
&& cp -r /ironic/etc/ironic/* /etc/ironic/ \
|
&& cp -r /ironic/etc/ironic/* /etc/ironic/ \
|
||||||
&& chown -R ironic: /etc/ironic /var/log/ironic /home/ironic \
|
&& chown -R ironic: /etc/ironic /var/lib/ironic \
|
||||||
&& sed -i 's|^exec_dirs.*|exec_dirs=/var/lib/kolla/venv/bin,/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin|g' /etc/ironic/rootwrap.conf
|
&& sed -i 's|^exec_dirs.*|exec_dirs=/var/lib/kolla/venv/bin,/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin|g' /etc/ironic/rootwrap.conf
|
||||||
|
|
||||||
|
ADD ironic_sudoers /etc/sudoers.d/kolla_ironic_sudoers
|
||||||
|
RUN chmod 750 /etc/sudoers.d \
|
||||||
|
&& chmod 440 /etc/sudoers.d/kolla_ironic_sudoers
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
RUN usermod -a -G kolla ironic \
|
COPY extend_start.sh /usr/local/bin/kolla_extend_start
|
||||||
|
|
||||||
|
RUN touch /usr/local/bin/kolla_ironic_extend_start \
|
||||||
|
&& chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_ironic_extend_start \
|
||||||
|
&& usermod -a -G kolla ironic \
|
||||||
&& chown -R ironic: /etc/ironic
|
&& chown -R ironic: /etc/ironic
|
||||||
|
|
||||||
{% block ironic_base_footer %}{% endblock %}
|
{% block ironic_base_footer %}{% endblock %}
|
||||||
|
12
docker/ironic/ironic-base/extend_start.sh
Normal file
12
docker/ironic/ironic-base/extend_start.sh
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
LOG_PATH=/var/log/kolla/ironic
|
||||||
|
|
||||||
|
if [[ ! -d "${LOG_PATH}" ]]; then
|
||||||
|
mkdir -p "${LOG_PATH}"
|
||||||
|
fi
|
||||||
|
if [[ $(stat -c %a "${LOG_PATH}") != "755" ]]; then
|
||||||
|
chmod 755 "${LOG_PATH}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
. /usr/local/bin/kolla_ironic_extend_start
|
1
docker/ironic/ironic-base/ironic_sudoers
Normal file
1
docker/ironic/ironic-base/ironic_sudoers
Normal file
@ -0,0 +1 @@
|
|||||||
|
ironic ALL = (root) NOPASSWD: /var/lib/kolla/venv/bin/ironic-rootwrap /etc/ironic/rootwrap.conf *
|
@ -9,25 +9,39 @@ MAINTAINER {{ maintainer }}
|
|||||||
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
|
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
|
||||||
{% set ironic_conductor_packages = [
|
{% set ironic_conductor_packages = [
|
||||||
'openstack-ironic-conductor',
|
'openstack-ironic-conductor',
|
||||||
'qemu-img'
|
'qemu-img',
|
||||||
|
'ipmitool',
|
||||||
|
'parted',
|
||||||
|
'gdisk',
|
||||||
|
'psmisc'
|
||||||
] %}
|
] %}
|
||||||
{% elif base_distro in ['ubuntu'] %}
|
{% elif base_distro in ['ubuntu'] %}
|
||||||
{% set ironic_conductor_packages = [
|
{% set ironic_conductor_packages = [
|
||||||
'ironic-conductor',
|
'ironic-conductor',
|
||||||
'qemu-utils',
|
'qemu-utils',
|
||||||
'ipmitool'
|
'ipmitool',
|
||||||
|
'gdisk',
|
||||||
|
'psmisc',
|
||||||
|
'parted'
|
||||||
] %}
|
] %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% elif install_type == 'source' %}
|
{% elif install_type == 'source' %}
|
||||||
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
|
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
|
||||||
{% set ironic_conductor_packages = [
|
{% set ironic_conductor_packages = [
|
||||||
'qemu-img',
|
'qemu-img',
|
||||||
'ipmitool'
|
'ipmitool',
|
||||||
|
'parted',
|
||||||
|
'gdisk',
|
||||||
|
'psmisc',
|
||||||
|
'fuse'
|
||||||
] %}
|
] %}
|
||||||
{% elif base_distro in ['ubuntu', 'debian'] %}
|
{% elif base_distro in ['ubuntu', 'debian'] %}
|
||||||
{% set ironic_conductor_packages = [
|
{% set ironic_conductor_packages = [
|
||||||
'qemu-utils',
|
'qemu-utils',
|
||||||
'ipmitool'
|
'ipmitool',
|
||||||
|
'gdisk',
|
||||||
|
'psmisc',
|
||||||
|
'parted'
|
||||||
] %}
|
] %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -21,8 +21,8 @@ MAINTAINER {{ maintainer }}
|
|||||||
{{ macros.install_packages(ironic_pxe_packages | customizable("packages")) }}
|
{{ macros.install_packages(ironic_pxe_packages | customizable("packages")) }}
|
||||||
|
|
||||||
COPY tftp-map-file /map-file
|
COPY tftp-map-file /map-file
|
||||||
COPY extend_start.sh /usr/local/bin/kolla_extend_start
|
COPY extend_start.sh /usr/local/bin/kolla_ironic_extend_start
|
||||||
RUN chmod 755 /usr/local/bin/kolla_extend_start
|
RUN chmod 755 /usr/local/bin/kolla_ironic_extend_start
|
||||||
|
|
||||||
{% block ironic_pxe_footer %}{% endblock %}
|
{% block ironic_pxe_footer %}{% endblock %}
|
||||||
{% block footer %}{% endblock %}
|
{% block footer %}{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user