Skip to content

Commit

Permalink
Merge pull request #2228 from IPvSean/devel
Browse files Browse the repository at this point in the history
fixing podman linger issue
  • Loading branch information
IPvSean authored Jan 17, 2025
2 parents 258ae36 + 3d52fd7 commit e90f448
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 8 deletions.
14 changes: 7 additions & 7 deletions exercises/ansible_network/7-controller-survey/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Demonstrate the use of Automation controller [survey feature](https://docs.ansib

![templates link](images/controller_templates.png)

2. Click on the blue `Add` button and select **Add job template** to create a new job template (make sure to select `Job Template` and not `Workflow Template`)
2. Click on the blue `Create template` button and select **Create job template** to create a new job template (make sure to select `Job Template` and not `Workflow Template`)

| Parameter | Value |
|---|---|
Expand All @@ -40,7 +40,7 @@ Demonstrate the use of Automation controller [survey feature](https://docs.ansib
| Playbook | `playbooks/network_banner.yml` |
| Credential | Workshop Credential |

3. Scroll down and click the blue `Save` button.
3. Scroll down and click the blue `Create job template` button.

### Step 2: Examine the playbook

Expand Down Expand Up @@ -114,7 +114,7 @@ In this step you will create a *"survey"* of user input form to collect input fr

![add survey button](images/controller_job_survey.png)

2. Click the blue **Add** button
2. Click the blue **Create survey question** button

![add survey button](images/controller_add_survey.png)

Expand All @@ -132,9 +132,9 @@ In this step you will create a *"survey"* of user input form to collect input fr

![workshop survey](images/controller_survey_q_one.png)

4. Click `Save`
4. Click `Save survey question`

5. Click the blue `Add` button back in the **Survey** tab to create another question
5. Click the blue `Create survey question` button back in the **Survey** tab to create another question

![add survey button](images/controller_add_survey.png)

Expand All @@ -154,7 +154,7 @@ In this step you will create a *"survey"* of user input form to collect input fr

![workshop survey](images/controller_survey_q_two.png)

7. Click `Save`
7. Click `Save survey question`

8. Ensure the toggle switch is set to `Survey Enabled`

Expand All @@ -178,7 +178,7 @@ In this step you will create a *"survey"* of user input form to collect input fr

![survey screen](images/controller_survey.png)

5. Click the blue **Launch** button to kick off the job.
5. Click the blue **Launch template** button to kick off the job.

![launch button](images/controller_launch.png)

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 35 additions & 1 deletion roles/control_node_always/tasks/20_workshop_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
mode: '0644'
when: username in inventory_hostname

- name: Copy instructor inventory to student1
- name: Copy instructor inventory to student
ansible.builtin.copy:
src: "{{ output_dir }}/instructor_inventory.txt"
dest: /tmp/instructor-inventory
Expand All @@ -102,11 +102,25 @@
# register: podman_pull
# until: podman_pull is not failed
# retries: 5
- name: Clean up libpod directories (if needed)
become: true
ansible.builtin.file:
path: "{{ item }}"
state: absent
with_items:
- /tmp/storage-run-1001/libpod/tmp
- /tmp/storage-run-1001/containers

- name: Enable lingering for user 1001
become: true
command: "loginctl enable-linger 1001 {{ username }}"

- name: Attempt to pull the primary or backup execution environment
block:
# Try pulling the primary execution environment
- name: Pull primary execution environment
become: true
become_user: "{{ username }}"
containers.podman.podman_image:
name: "{{ lookup('vars', workshop_type + '_ee') }}"
register: primary_podman_pull
Expand All @@ -116,8 +130,28 @@
rescue:
# Pull the backup execution environment if primary fails
- name: Pull backup execution environment
become: true
become_user: "{{ username }}"
containers.podman.podman_image:
name: "{{ lookup('vars', workshop_type + '_ee_backup') }}"
register: backup_podman_pull
retries: 5
until: backup_podman_pull is not failed

- containers.podman.podman_tag:
image: "{{ lookup('vars', workshop_type + '_ee_backup') }}"
target_names:
- "{{ lookup('vars', workshop_type + '_ee') }}"

- name: Enable lingering for user 1001
become: true
command: "loginctl enable-linger 1001 {{ username }}"

- name: Clean up libpod directories (if needed)
become: true
ansible.builtin.file:
path: "{{ item }}"
state: absent
with_items:
- /tmp/storage-run-1001/libpod/tmp
- /tmp/storage-run-1001/containers

0 comments on commit e90f448

Please sign in to comment.