diff --git a/README.rst b/README.rst index 844bd3939..a95d7c18d 100644 --- a/README.rst +++ b/README.rst @@ -3,3 +3,40 @@ stx-ansible-playbooks ===================== StarlingX Bootstrap and Deployment Playbooks + +Execution environment +===================== + +- Linux like OS (recent Linux based distributions, MacOS, Cygwin) +- Python 2.7 + +Additional Required Packages +============================ +The playbooks in this repo have been verified with the following versions of Ansible +and StarlingX playbooks dependencies: + +- sshpass 1.06 +- python2-ptyprocess 0.5 +- python2-pexpect 4.6 +- ``ansible`` 2.7.5 + +Supported StarlingX Releases +============================ +The playbooks in this repo are compatible with the following StarlingX releases: + +- 19.01 + +Executing StarlingX Playbooks +============================= + +Executing Bootstrap Playbook +---------------------------- +Please refer to ``StarlingX Deployment Guides``, section **Configuration controller-0** +of the respective system configuration for instructions on how to set up and execute +the bootstrap playbook from another host. + +References +========== +.. [1] https://docs.ansible.com/ansible/2.7/installation_guide/index.html +.. [2] https://docs.starlingx.io/deployment_guides/index.html + diff --git a/examples/remote/hostname1.yml b/examples/remote/hostname1.yml new file mode 100644 index 000000000..5ed5230d1 --- /dev/null +++ b/examples/remote/hostname1.yml @@ -0,0 +1,3 @@ +timezone: Japan +cluster_host_subnet: 192.168.207.0/24 +external_oam_floating_address: 172.16.0.17 diff --git a/examples/remote/hostname2.yml b/examples/remote/hostname2.yml new file mode 100644 index 000000000..06ba025b2 --- /dev/null +++ b/examples/remote/hostname2.yml @@ -0,0 +1,3 @@ +system_mode: duplex +management_subnet: 192.168.204.0/24 +external_oam_floating_address: 172.16.0.144 diff --git a/examples/remote/hosts b/examples/remote/hosts new file mode 100644 index 000000000..b4183a6cb --- /dev/null +++ b/examples/remote/hosts @@ -0,0 +1,15 @@ +--- +all: + hosts: + hostname1: + # Ansible host IP is the IP of the controller host that is externally + # accessible for controller bootstrap and system deployment purposes. + # This IP can be created via DHCP or statically. + ansible_host: 172.16.0.17 + hostname2: + ansible_host: 172.16.0.144 + + vars: + ansible_ssh_user: sysadmin + ansible_ssh_pass: St8rlingX* + ansible_become_pass: St8rlingX* diff --git a/examples/remote/sample_secrets.yml b/examples/remote/sample_secrets.yml new file mode 100644 index 000000000..63ee779d6 --- /dev/null +++ b/examples/remote/sample_secrets.yml @@ -0,0 +1,24 @@ +# The following are configuration parameters that should be stored +# in secrets files using Ansible vault. +# +# Bootstrap specific parameters stored in the vault must have vault_ +# prefix. The same rule is not applied to Ansible specific parameters. +# + +# The following settings could be host specific, in which case they +# can be placed in the _secrets.yml where +# applicable. +vault_admin_username: stx-admin +vault_admin_password: Boot5trap* + +# The following settings are usually common to all hosts, in which +# case they can be placed in the secrets.yml file. +vault_password_change_responses: + yes/no: 'yes' + sysadmin*: 'sysadmin' + \(current\) UNIX password: 'sysadmin' + (?i)New password: 'Boot5trap*' + (?i)Retype new password: 'Boot5trap*' + +ansible_become_pass: Boot5trap* +ansible_ssh_pass: Boot5trap* diff --git a/examples/remote/site.yml b/examples/remote/site.yml new file mode 100644 index 000000000..8efa17927 --- /dev/null +++ b/examples/remote/site.yml @@ -0,0 +1,7 @@ +# Configuration parameters in this file will apply to all +# hosts in the hosts file unless they are overwritten in the +# inventory_hostname.yml file or at the command line. +external_oam_subnet: 172.16.0.0/12 +external_oam_gateway_address: 172.16.0.1 +dns_servers: + - 1.1.1.1 diff --git a/playbookconfig/playbookconfig/playbooks/bootstrap/bootstrap.yml b/playbookconfig/playbookconfig/playbooks/bootstrap/bootstrap.yml index 8050cc391..3a2a02860 100644 --- a/playbookconfig/playbookconfig/playbooks/bootstrap/bootstrap.yml +++ b/playbookconfig/playbookconfig/playbooks/bootstrap/bootstrap.yml @@ -17,7 +17,8 @@ path: "{{ item }}" register: files_to_import with_items: - - "{{ override_files_dir }}/secret" + - "{{ override_files_dir }}/secrets.yml" + - "{{ override_files_dir }}/{{ inventory_hostname }}_secrets.yml" - "{{ override_files_dir }}/site.yml" - "{{ override_files_dir }}/{{ inventory_hostname }}.yml" delegate_to: localhost diff --git a/playbookconfig/playbookconfig/playbooks/bootstrap/roles/prepare-env/tasks/main.yml b/playbookconfig/playbookconfig/playbooks/bootstrap/roles/prepare-env/tasks/main.yml index 50e4f06ec..a4baadd03 100644 --- a/playbookconfig/playbookconfig/playbooks/bootstrap/roles/prepare-env/tasks/main.yml +++ b/playbookconfig/playbookconfig/playbooks/bootstrap/roles/prepare-env/tasks/main.yml @@ -232,6 +232,11 @@ software_version: "{{ sw_version_result.stdout_lines[0] }}" system_type: "{{ system_type_result.stdout_lines[0] }}" + - name: Fail if host software version is not supported by this playbook + fail: + msg: "This playbook is not compatible with StarlingX software version {{ software_version }}." + when: software_version not in supported_release_versions + - name: Set config path facts set_fact: keyring_permdir: "{{ platform_path + '/.keyring/' + software_version }}" diff --git a/playbookconfig/playbookconfig/playbooks/bootstrap/roles/prepare-env/vars/main.yml b/playbookconfig/playbookconfig/playbooks/bootstrap/roles/prepare-env/vars/main.yml index fa64d117f..1290fc91e 100644 --- a/playbookconfig/playbookconfig/playbooks/bootstrap/roles/prepare-env/vars/main.yml +++ b/playbookconfig/playbookconfig/playbooks/bootstrap/roles/prepare-env/vars/main.yml @@ -3,3 +3,5 @@ image_brand: StarlingX platform_path: /opt/platform puppet_path: /opt/platform/puppet standard_root_disk_size: 500 +supported_release_versions: + - "19.01"