-
Notifications
You must be signed in to change notification settings - Fork 167
Fix: Resolve CI checks fail - Module at add chdir(#102) #218
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 12 commits
269c66f
a699771
09299f1
ceaee68
17f8c02
3206c5c
faf1ea4
b8fcfdd
a18fce2
12d3db3
8788d4d
c7d610b
99585a9
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 |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| minor_changes: | ||
| - at - add option ``chdir`` to permit to launch the ``at`` command from a specific directory (https://github.com/ansible-collections/ansible.posix/issues/13). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,2 @@ | ||
| shippable/posix/group1 | ||
| destructive | ||
| disabled # fixme package |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ | |
| # You should have received a copy of the GNU General Public License | ||
| # along with Ansible. If not, see <http://www.gnu.org/licenses/>. | ||
|
|
||
|
|
||
| - set_fact: output_dir_test={{output_dir}}/at | ||
|
|
||
| - name: make sure our testing sub-directory does not exist | ||
|
|
@@ -28,35 +29,103 @@ | |
| ## at | ||
| ## | ||
|
|
||
| - name: define distros to attempt installing at on | ||
| set_fact: | ||
| package_distros: | ||
| - RedHat | ||
| - CentOS | ||
| - ScientificLinux | ||
| - Fedora | ||
| - Ubuntu | ||
| - Debian | ||
| - openSUSE Leap | ||
|
|
||
| - name: ensure at is installed | ||
| package: | ||
| name: at | ||
| state: present | ||
| when: ansible_distribution in package_distros | ||
|
|
||
| - name: run the first example | ||
| at: | ||
| command: "ls -d / > /dev/null" | ||
| count: 20 | ||
| units: minutes | ||
| register: at_test0 | ||
| - debug: var=at_test0 | ||
| - name: validate results | ||
| assert: | ||
| that: | ||
| - name: Run At tests | ||
| block: | ||
| - name: define distros to attempt installing at on | ||
| set_fact: | ||
| package_distros: | ||
| - RedHat | ||
| - CentOS | ||
| - ScientificLinux | ||
| - Fedora | ||
| - Ubuntu | ||
| - Debian | ||
| - openSUSE Leap | ||
|
|
||
| - name: ensure at is installed | ||
| package: | ||
| name: at | ||
| state: present | ||
| when: ansible_distribution in package_distros | ||
|
|
||
| - name: run the first example | ||
| at: | ||
| command: "ls -d / > /dev/null" | ||
| count: 20 | ||
| units: minutes | ||
| register: at_test0 | ||
|
|
||
| - debug: var=at_test0 | ||
|
|
||
| - name: validate results | ||
| assert: | ||
| that: | ||
| - 'at_test0.changed is defined' | ||
| - 'at_test0.count is defined' | ||
| - 'at_test0.script_file is defined' | ||
| - 'at_test0.state is defined' | ||
| - 'at_test0.units is defined' | ||
|
|
||
| - name: Add a useless command using at | ||
| at: | ||
| command: /bin/logger 'AT task ran from Ansible' | ||
| count: 1 | ||
| units: minutes | ||
| unique: yes | ||
| register: at_add | ||
|
|
||
| - debug: var=at_add | ||
|
|
||
| - name: Wait for at to run the previous command | ||
| pause: | ||
| minutes: 1 | ||
|
|
||
| - name: Add a useless command | ||
| at: | ||
| command: /bin/logger 'AT task ran from Ansible' | ||
| count: 1 | ||
| units: minutes | ||
| unique: true | ||
| state: absent | ||
| register: at_removal | ||
|
|
||
| - debug: var=at_removal | ||
|
|
||
| - name: Wait for at to run the previous command | ||
| pause: | ||
| minutes: 1 | ||
|
|
||
| - name: Validate results | ||
| assert: | ||
| that: | ||
| - at_add is changed | ||
| - at_removal is changed | ||
|
|
||
| - name: Create an at command with chdir with valid value | ||
| at: | ||
| command: /bin/logger 'AT task ran from Ansible with chdir' | ||
| count: 1 | ||
| units: minutes | ||
| chdir: /tmp | ||
| register: at_chdir_valid | ||
| - debug: var=at_chdir_valid | ||
|
|
||
| - name: Create an at command with chdir with invalid value | ||
| at: | ||
| command: /bin/logger 'AT task ran from Ansible with chdir' | ||
| count: 1 | ||
| units: minutes | ||
| chdir: /invalid | ||
| register: at_chdir_invalid | ||
| ignore_errors: true | ||
|
|
||
| - debug: var=at_chdir_invalid | ||
|
|
||
| - name: Validate results | ||
| assert: | ||
| that: | ||
| - at_chdir_valid is changed | ||
| - at_chdir_invalid is changed | ||
| when: | ||
| - not (ansible_facts['distribution'] in ('Ubuntu','FreeBSD')) | ||
| - not (ansible_distribution == "CentOS" and ansible_distribution_version is version('6', '==')) | ||
|
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. Any reason why CentOS 6 is disabled?
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. I think the problem here is that despite what the man page says, the version of
Collaborator
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. |
||
Uh oh!
There was an error while loading. Please reload this page.