-
Notifications
You must be signed in to change notification settings - Fork 2
Initialized ansible playbook integration #1
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ad75a03
Initialized ansible playbook integration
pleoxconfusa 9d57fbd
Refactor tasks.yml for Linux Base Objects to align with feedback
pleoxconfusa 40aab27
Update required_files lists for Ubuntu components and Linux Base Obje…
pleoxconfusa 3edbc4b
Update to include images and adjust vars/tasks to use download_dir in…
pleoxconfusa 8932d93
Fixed images directory
pleoxconfusa c7aad12
Apply suggestions from code review
sdelliot 6c2243d
Update src/firewheel_repo_linux/linux/INSTALL/vars.yml
sdelliot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
- name: Create VM resources directory | ||
ansible.builtin.file: | ||
path: "{{ download_dir }}" | ||
state: directory | ||
|
||
- name: Create parent directories | ||
ansible.builtin.file: | ||
path: "{{ download_dir }}/{{ item.parent }}" | ||
state: directory | ||
loop: "{{ files }}" | ||
|
||
- name: Download and verify files | ||
ansible.builtin.get_url: | ||
url: "{{ item.url }}" | ||
dest: "{{ download_dir }}/{{ item.parent }}/{{ item.dest }}" | ||
checksum: "sha256:{{ item.sha256 }}" | ||
loop: "{{ files }}" | ||
|
||
- name: Generate SSH key pair (if applicable) | ||
ansible.builtin.openssh_keypair: | ||
path: "{{ ssh_profile.path }}/id_rsa" | ||
type: rsa | ||
size: 2048 | ||
when: ssh_profile.ssh_keypair | default(false) | ||
|
||
- name: Add public key to authorized_keys | ||
ansible.builtin.copy: | ||
content: "{{ lookup('file', ssh_profile.path + '/id_rsa.pub') }}" | ||
dest: "{{ ssh_profile.path }}/authorized_keys" | ||
when: ssh_profile.ssh_keypair | default(false) | ||
|
||
- name: Create SSH config file | ||
ansible.builtin.copy: | ||
content: | | ||
Host * | ||
StrictHostKeyChecking no | ||
UserKnownHostsFile /dev/null | ||
ForwardX11Trusted yes | ||
dest: "{{ ssh_profile.path }}/config" | ||
when: ssh_profile.ssh_keypair | default(false) | ||
|
||
- name: Set permissions for SSH files | ||
ansible.builtin.file: | ||
path: "{{ ssh_profile.path }}/{{ item.file }}" | ||
mode: "{{ item.mode }}" | ||
loop: "{{ ssh_profile.permissions }}" | ||
when: ssh_profile.ssh_keypair | default(false) | ||
|
||
- name: Compress profiles into tarball | ||
ansible.builtin.archive: | ||
path: | ||
- "{{ download_dir }}/profiles" | ||
- "{{ ssh_profile.path }}" | ||
dest: "{{ download_dir }}/combined_profiles.tgz" | ||
format: gz | ||
|
||
- name: Clean up temporary files | ||
ansible.builtin.file: | ||
path: | ||
- "{{ download_dir }}/profiles" | ||
- "{{ ssh_profile.path }}" | ||
state: absent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
download_dir: "{{ mc_dir }}/vm_resources" | ||
files: | ||
- parent: "profiles" | ||
dest: ".vimrc" | ||
url: "https://github.com/amix/vimrc/raw/3c26776552ecb436bd8090c973435a68dbe8cb62/vimrcs/basic.vim" | ||
sha256: "bde3c8e77682d22bde680919d3416524fbc4e13d8aaf2ed25bcd3bdc3b6875b1" | ||
- parent: "profiles" | ||
dest: ".bashrc" | ||
url: "https://github.com/sudonitesh/beautiful-bash/raw/4ad53ee9d1b0e2104e9dd77ae4f74e71262395d5/.bashrc" | ||
sha256: "19fca5072753f1bf8da1d4770d7dfe409c84e29ad21bbe92abbe37b7232df249" | ||
- parent: "profiles" | ||
dest: "tmux-cssh" | ||
url: "https://gitlab.com/peikk0/tmux-cssh/-/raw/a35957f7d9a0dbfd296b73dbb6f56ee4c193dc56/tmux-cssh" | ||
sha256: "cd44ed3321abc190a0a128b944b004857770e8ea18c03952e63a234cb3056098" | ||
|
||
ssh_profile: | ||
path: "{{ download_dir }}/.ssh" | ||
ssh_keypair: true | ||
permissions: | ||
- file: "authorized_keys" | ||
mode: "0600" | ||
- file: "config" | ||
mode: "0600" | ||
|
||
required_files: | ||
- destination: "{{ download_dir }}/combined_profiles.tgz" | ||
sdelliot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- destination: "{{ download_dir }}/tmux-cssh" | ||
- destination: "{{ mc_dir }}/vm_resources/chpasswd.sh" | ||
- destination: "{{ mc_dir }}/vm_resources/configure_ips.sh" | ||
- destination: "{{ mc_dir }}/vm_resources/set_hostname.sh" | ||
- destination: "{{ mc_dir }}/vm_resources/set_netplan_interfaces.sh" | ||
- destination: "{{ mc_dir }}/vm_resources/set_ulimit.sh" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
required_files: | ||
- destination: "{{ mc_dir }}/images/ubuntu-18.04.5-server-amd64.qcow2.xz" | ||
- destination: "{{ mc_dir }}/images/ubuntu-18.04.5-desktop-amd64.qcow2.xz" | ||
sdelliot marked this conversation as resolved.
Show resolved
Hide resolved
|
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
- name: Create VM resources directory | ||
ansible.builtin.file: | ||
path: "{{ download_dir }}" | ||
state: directory | ||
|
||
- name: Create parent directories | ||
ansible.builtin.file: | ||
path: "{{ download_dir }}/{{ item.name }}" | ||
state: directory | ||
loop: "{{ parents }}" | ||
|
||
- name: Download and verify files | ||
ansible.builtin.get_url: | ||
url: "{{ item.url }}" | ||
dest: "{{ download_dir }}/{{ item.parent }}/{{ item.dest }}" | ||
checksum: "sha256:{{ item.sha256 }}" | ||
loop: "{{ files }}" | ||
|
||
- name: Compress parent directories into tarballs | ||
ansible.builtin.archive: | ||
path: "{{ download_dir }}/{{ item.name }}" | ||
dest: "{{ download_dir }}/{{ item.tarball }}" | ||
format: gz | ||
loop: "{{ parents }}" | ||
|
||
- name: Remove parent directories | ||
ansible.builtin.file: | ||
path: "{{ download_dir }}/{{ item.name }}" | ||
state: absent | ||
loop: "{{ parents }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
download_dir: "{{ mc_dir }}/vm_resources/debs" | ||
files: | ||
- parent: "pssh_debs" | ||
dest: "pssh_2.3.4-2_all.deb" | ||
url: "http://archive.ubuntu.com/ubuntu/pool/universe/p/pssh/pssh_2.3.4-2_all.deb" | ||
sha256: "08689810f7f7f87934de47b59c2c9791eeef61059cd45a9388a53035e56d941d" | ||
- parent: "pssh_debs" | ||
dest: "python3-psshlib_2.3.4-2_all.deb" | ||
url: "http://archive.ubuntu.com/ubuntu/pool/universe/p/pssh/python3-psshlib_2.3.4-2_all.deb" | ||
sha256: "8e794c0ae1fa311f4f461ae42fe6d84b5dc8e0e425ce9fa37b2c1345fbc39e7b" | ||
|
||
parents: | ||
- name: "pssh_debs" | ||
tarball: "pssh_2.3.4-2_all_debs.tgz" | ||
|
||
required_files: | ||
- destination: "{{ download_dir }}/pssh_2.3.4-2_all_debs.tgz" | ||
sdelliot marked this conversation as resolved.
Show resolved
Hide resolved
sdelliot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- destination: "{{ mc_dir }}/images/ubuntu-22.04-server-amd64.qcow2.tgz" | ||
- destination: "{{ mc_dir }}/images/ubuntu-22.04-desktop-amd64.qcow2.tgz" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.