-
Notifications
You must be signed in to change notification settings - Fork 75
Create role to deploy and configure MAAS #788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
be396ce
0330175
8e85a65
f21ecae
7fa60a0
494ac49
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,10 +65,14 @@ | |
| ansible.builtin.blockinfile: | ||
| path: "{{ curtin_userdata_path.stdout if maas_install_method == 'snap' else '/etc/maas/preseeds/curtin_userdata' }}" | ||
| insertafter: EOF | ||
| block: | | ||
| 90_create_cm_user: ["curtin", "in-target", "--", "sh", "-c", "useradd {{ cm_user }} -m -s /bin/bash -g sudo"] | ||
| 92_delete_cm_pass: ["curtin", "in-target", "--", "sh", "-c", "passwd -d cm"] | ||
| 94_configure_sudo: ["curtin", "in-target", "--", "sh", "-c", "printf '%%sudo ALL=(ALL) NOPASSWD: ALL\nDefaults !requiretty\nDefaults visiblepw' >> /etc/sudoers.d/cephlab_sudo"] | ||
| 96_create_ssh_directory: ["curtin", "in-target", "--", "sh", "-c", "mkdir -p /home/cm/.ssh"] | ||
| 98_copy_ssh_keys_cm: ["curtin", "in-target", "--", "sh", "-c", "echo '{{ cm_user_ssh_keys|join('\n') }}' >> /home/cm/.ssh/authorized_keys"] | ||
| block: |2 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why change the indent level and add this weird indent-removal character?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When you add the block inside the curtin script you need to use the exact indent level the file already has otherwise curtin will ignore those commands. |
||
| 90_create_cm_user: ["curtin", "in-target", "--", "sh", "-c", "useradd {{ cm_user }} -m -s /bin/bash -g sudo"] | ||
djgalloway marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 92_delete_cm_pass: ["curtin", "in-target", "--", "sh", "-c", "passwd -d cm"] | ||
| 94_configure_sudo: ["curtin", "in-target", "--", "sh", "-c", "printf '%%sudo ALL=(ALL) NOPASSWD: ALL\nDefaults !requiretty\nDefaults visiblepw' >> /etc/sudoers.d/cephlab_sudo"] | ||
| 96_create_ssh_directory: ["curtin", "in-target", "--", "sh", "-c", "mkdir -p /home/cm/.ssh"] | ||
| 98_copy_ssh_keys_cm: ["curtin", "in-target", "--", "sh", "-c", "echo '{{ cm_user_ssh_keys|join('\n') }}' >> /home/cm/.ssh/authorized_keys"] | ||
| when: "cm_user_ssh_keys is defined and cm_user is defined" | ||
|
|
||
| - name: Configure global kernel options | ||
| command: "maas {{ maas_admin_username }} maas set-config name=kernel_opts value='{{ global_kernel_opt }}'" | ||
| when: "global_kernel_opt is defined" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,15 +49,13 @@ | |
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why are these changes in this commit? config_maas.yml existed before the addition of console=, yes?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At the end I will just squash all my commits together, but you are right, I will try to separate my commits better in order to do this review process easier. |
||
| - import_tasks: initialize_secondary_rack.yml | ||
|
|
||
| # Configure MAAS | ||
| - import_tasks: config_maas.yml | ||
|
|
||
| # Logging into the MAAS API to use CLI | ||
| - name: Get API key | ||
| command: maas apikey --username={{ maas_admin_username }} | ||
| when: inventory_hostname in groups['maas_region_rack_server'] | ||
| tags: | ||
| - config_dhcp | ||
| - config_maas | ||
| - add_machines | ||
| - config_dns | ||
| - config_ntp | ||
|
|
@@ -69,11 +67,15 @@ | |
| when: inventory_hostname in groups['maas_region_rack_server'] | ||
| tags: | ||
| - config_dhcp | ||
| - config_maas | ||
| - add_machines | ||
| - config_dns | ||
| - config_ntp | ||
| - add_users | ||
|
|
||
| # Configure MAAS | ||
| - import_tasks: config_maas.yml | ||
|
|
||
| # Configure NTP Service | ||
| - import_tasks: config_ntp.yml | ||
|
|
||
|
|
@@ -102,6 +104,7 @@ | |
| command: "maas logout {{ maas_admin_username }}" | ||
| tags: | ||
| - config_dhcp | ||
| - config_maas | ||
| - add_machines | ||
| - config_dns | ||
| - config_ntp | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commit message: this is a "task", not a module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will squash all my commits later.