This doesn't work. Networking stumped me.

This commit is contained in:
2023-06-13 08:19:47 -04:00
parent 59f3c2c5f2
commit d2019bfb33
11 changed files with 1209 additions and 29 deletions

View File

@@ -4,15 +4,24 @@
become: true
tasks:
- name: Add RDO Antelope repo to dnf
ansible.builtin.dnf:
name: 'https://www.rdoproject.org/repos/rdo-release.el9.rpm'
state: present
disable_gpg_check: true
- name: Update all packages
ansible.builtin.package:
name: '*'
state: latest
- name: Packages installed
ansible.builtin.package:
ansible.builtin.dnf:
name: "{{ install_packages }}"
state: present
allowerasing: true
# TODO: Restart NetworkManager service if NetworkManager-ovs package is updated
- name: Create stack user for admin
ansible.builtin.user:
@@ -29,13 +38,27 @@
user: stack
state: present
- name: Install openstack admin ssh key
ansible.posix.authorized_key:
user: stack
key: "{{ lookup('file', '{{ item }}') }}"
state: present
with_fileglob:
- openstack_admin.pub
- name: OpenVSwitch Service enabled and started
ansible.builtin.service:
name: openvswitch
state: started
enabled: true
- name: Bootstrap Network configuration
hosts: all
become: true
roles:
- fedora.linux_system_roles.network
# TODO: Fix this
# - name: Install openstack admin ssh key
# ansible.posix.authorized_key:
# user: root
# key: "{{ lookup('file', '{{ item }}') }}"
# state: present
# with_fileglob:
# - openstack_admin.pub
- name: Prepare for openstack-ansible deployment
@@ -50,21 +73,27 @@
masked: true
state: stopped
- name: Copy ssh key to .ssh directory
ansible.builtin.copy:
content: "{{ openssh_private_key }}"
dest: /opt/stack/.ssh/openstack_admin
owner: stack
group: stack
mode: '0600'
- name: Enable SELinux
ansible.posix.selinux:
state: permissive
policy: targeted
- name: Copy public key to .ssh directory
ansible.builtin.copy:
src: openstack_admin.pub
dest: /opt/stack/.ssh/id_rsa.pub
owner: stack
group: stack
mode: '0600'
# Fix this
# - name: Copy ssh key to .ssh directory
# ansible.builtin.copy:
# content: "{{ openssh_private_key }}"
# dest: /root/.ssh/openstack_admin
# owner: root
# group: root
# mode: '0600'
# - name: Copy public key to .ssh directory
# ansible.builtin.copy:
# src: openstack_admin.pub
# dest: /root/.ssh/id_rsa.pub
# owner: root
# group: root
# mode: '0600'
- name: Clone openstack-ansible repo into /opt/openstack-ansible
ansible.builtin.git:
@@ -78,12 +107,26 @@
cmd: '/opt/openstack-ansible/scripts/bootstrap-ansible.sh'
creates: /usr/local/bin/openstack-ansible
- name: /etc/openstack_deploy exists
ansible.builtin.file:
path: /etc/openstack_deploy
state: directory
mode: '0755'
owner: stack
group: stack
- name: Copy files to /etc/openstack_deploy directory
ansible.builtin.copy:
src: '{{ item }}'
dest: /etc/openstack_deploy/{{ item }}
mode: '0600'
owner: stack
group: stack
with_items:
- openstack_user_config.yml
- user_secrets.yml
- user_variables.yml
- name: Prepare compute hosts
hosts: compute
become: true
tasks:
- name: Reduce kernel log level
ansible.builtin.lineinfile:
path: /etc/sysctl.conf
line: kernel.printk='4 1 7 4'