diff --git a/README.md b/README.md index 8a6affc..8f50eb9 100644 --- a/README.md +++ b/README.md @@ -118,3 +118,7 @@ Release Notes **3.2.0** * Update plugin to inject task into deployment graph instead of being run as post-deployment task + +**3.2.1** + +* Plugin is able to create system user `nova` on compute nodes with same uid/gid diff --git a/deployment_scripts/puppet/create_user.pp b/deployment_scripts/puppet/create_user.pp new file mode 100644 index 0000000..40970b8 --- /dev/null +++ b/deployment_scripts/puppet/create_user.pp @@ -0,0 +1,16 @@ +notice('PLUGIN nova-nfs: create_user.pp') + +$nova_nfs_hash = hiera_hash('nova_nfs', {}) + +if $nova_nfs_hash['create_nova_user'] { + user { 'nova': + uid => 499, + gid => 499, + home => '/var/lib/nova', + shell => '/bin/bash', + } + + group { 'nova': + gid => 499, + } +} diff --git a/deployment_scripts/puppet/site.pp b/deployment_scripts/puppet/site.pp index e0d05c6..3c4419b 100644 --- a/deployment_scripts/puppet/site.pp +++ b/deployment_scripts/puppet/site.pp @@ -1,5 +1,10 @@ -$fuel_settings = parseyaml(file('/etc/astute.yaml')) +notice('PLUGIN nova-nfs: site.pp') + +$nova_nfs_hash = hiera_hash('nova_nfs', {}) +$nfs_volume_for_nova = pick($nova_nfs_hash['nfs_volume_for_nova']) +$nfs_mount_point_nova = pick($nova_nfs_hash['nfs_mount_point_nova'], '/mnt/nova') + class { 'nova_nfs': - nfs_volume_for_nova => $fuel_settings['nova_nfs']['nfs_volume_for_nova'], - nfs_mount_point_nova => $fuel_settings['nova_nfs']['nfs_mount_point_nova'], + nfs_volume_for_nova => $nfs_volume_for_nova, + nfs_mount_point_nova => $nfs_mount_point_nova, } diff --git a/deployment_tasks.yaml b/deployment_tasks.yaml index 3999e0a..8107748 100644 --- a/deployment_tasks.yaml +++ b/deployment_tasks.yaml @@ -7,3 +7,13 @@ puppet_manifest: puppet/site.pp puppet_modules: "puppet/modules/:/etc/puppet/modules/" timeout: 360 + +- id: nova-nfs-create-nova-user + type: puppet + groups: [compute] + required_for: [top-role-compute] + requires: [deploy_start] + parameters: + puppet_manifest: puppet/create_user.pp + puppet_modules: "puppet/modules/:/etc/puppet/modules/" + timeout: 360 diff --git a/environment_config.yaml b/environment_config.yaml index ea1fb22..29c5c5f 100644 --- a/environment_config.yaml +++ b/environment_config.yaml @@ -17,3 +17,9 @@ attributes: regex: source: '^/(?:[\w-]+\/?)+$' error: "Valid characters are: '/', '0-9', 'a-z', 'A-Z', '_', '-'" + create_nova_user: + value: true + label: 'Create system user `nova`' + description: 'Create system user `nova` to ensure same uid/git for it on all compute nodes' + weight: 30 + type: "checkbox" diff --git a/metadata.yaml b/metadata.yaml index e3c19e8..8688c19 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -2,7 +2,7 @@ name: nova_nfs title: Nova NFS plugin # Plugin version -version: 3.2.0 +version: 3.2.1 # Description description: Enables Nova to use NFS volume as storage backend for ephemeral volumes # Required fuel version