mirror of
				https://github.com/ansible-collections/community.general.git
				synced 2025-10-24 21:14:00 -07:00 
			
		
		
		
	
					parent
					
						
							
								046d430a26
							
						
					
				
			
			
				commit
				
					
						91ab88dac7
					
				
			
		
					 2 changed files with 24 additions and 2 deletions
				
			
		|  | @ -380,6 +380,11 @@ def main(): | ||||||
|     virtualenv_python = module.params['virtualenv_python'] |     virtualenv_python = module.params['virtualenv_python'] | ||||||
|     chdir = module.params['chdir'] |     chdir = module.params['chdir'] | ||||||
|     umask = module.params['umask'] |     umask = module.params['umask'] | ||||||
|  |     env = module.params['virtualenv'] | ||||||
|  | 
 | ||||||
|  |     venv_created = False | ||||||
|  |     if chdir: | ||||||
|  |         env = os.path.join(chdir, env) | ||||||
| 
 | 
 | ||||||
|     if umask and not isinstance(umask, int): |     if umask and not isinstance(umask, int): | ||||||
|         try: |         try: | ||||||
|  | @ -402,8 +407,6 @@ def main(): | ||||||
|         err = '' |         err = '' | ||||||
|         out = '' |         out = '' | ||||||
| 
 | 
 | ||||||
|         env = module.params['virtualenv'] |  | ||||||
|         venv_created = False |  | ||||||
|         if env: |         if env: | ||||||
|             if not os.path.exists(os.path.join(env, 'bin', 'activate')): |             if not os.path.exists(os.path.join(env, 'bin', 'activate')): | ||||||
|                 venv_created = True |                 venv_created = True | ||||||
|  |  | ||||||
|  | @ -183,3 +183,22 @@ | ||||||
|   assert: |   assert: | ||||||
|     that: |     that: | ||||||
|       - "pip_install_venv.changed" |       - "pip_install_venv.changed" | ||||||
|  | 
 | ||||||
|  | # https://github.com/ansible/ansible/issues/25122 | ||||||
|  | - name: ensure is a fresh virtualenv | ||||||
|  |   file: | ||||||
|  |     state: absent | ||||||
|  |     name: "{{ output_dir }}/pipenv" | ||||||
|  | 
 | ||||||
|  | - name: install requirements file into virtual + chdir | ||||||
|  |   pip: | ||||||
|  |    name: q | ||||||
|  |    chdir: "{{ output_dir }}/" | ||||||
|  |    virtualenv: "pipenv" | ||||||
|  |    state: present | ||||||
|  |   register: venv_chdir | ||||||
|  | 
 | ||||||
|  | - name: make sure fresh virtualenv + chdir report changed | ||||||
|  |   assert: | ||||||
|  |     that: | ||||||
|  |       - "venv_chdir.changed" | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue