[ansible-project] Unable to create the partition using [parted] module

2023-09-05 Thread Irosh IFS
Hi ,
 Terraform create linux vm using custom image which has an attached the 
managed data disk and that data disk is already portioned. In papally 
terraform added the second and third  data disk into vm .

Now i tried to run ansible playbook to partitioned the second and third 
data disk (lun values = 2 and 3) using parted module  

- name: fact for lun1 and lun2
  set_fact: 
lun: "[ '2','3' ]"

- name: lun disks information
  community.general.parted:
device: /dev/disk/azure/scsi1/lun{{ item }}
unit: MiB
  loop: '{{ lun }}'
  register: lun_info

- name: Use parted to make new disk and label
  community.general.parted:
device: /dev/disk/azure/scsi1/lun{{ item.item }}
label: "gpt"
number: '{{ item.item }}'
state: present
part_end: "100%"
resize: true
  loop: '{{ lun_info.results }}'

So then error msg will be as below . So can someone help on this ?
 
"changed": false,
912 

 
"err": "Error: You requested a partition from 0.00kiB to 536870912kiB 
(sectors 0..1073741823).\nThe closest location we can manage is 17.0kiB to 
1024kiB (sectors 34..2047).\n",
913 

 
"item": {
914 

 
"ansible_loop_var": "item",
915 

 
"changed": false,
916 

 
"disk": {
917 

 
"dev": "/dev/sdd",
918 

 
"logical_block": 512,
919 

 
"model": "Msft Virtual Disk",
920 

 
"physical_block": 4096,
921 

 
"size": 524288.0,
922 

 
"table": "gpt",
923 

 
"unit": "mib"
924 

 
},
925 

 
"failed": false,
926 

 
"invocation": {
927 

 
"module_args": {
928 

 
"align": "optimal",
929 

 
"device": "/dev/disk/azure/scsi1/lun2",
930 

 
"flags": null,
931 

 
"fs_type": null,
932 

 
"label": "msdos",
933 

 
"name": null,
934 

 
"number": null,
935 

 
"part_end": "100%",
936 

 
"part_start": "0%",
937 

 
"part_type": "primary",
938 

 
"resize": false,
939 

 
"state": "info",
940 

 
"unit": "MiB"
941 

 
}
942 

 
},
943 

 
"item": "2",
944 

 
"partitions": [
945 

 
{
946 

 
"begin": 1.0,
947 

 
"end": 524287.0,
948 


Re: [ansible-project] Unable to create the partition

2022-07-11 Thread Ashok Reddy
Thanks for providing your input.

On Mon, Jul 11, 2022 at 12:37 PM David Logan  wrote:

> On the systems that I build, the /boot partition is simply an ext4 or xfs
> file system. I would not be trying to use logical volume manager to try to
> build /boot.
>
> I would also look at using a kick-start method or similar to automate the
> build and get the file systems built there rather than with ansible.
>
> Anyway that is what I do, others may have a different method that may work
> better in your case.
>
> When in trouble, or in doubt
> Run in circles, scream and shout
> On 11 July 2022, at 3:58 pm, Ashok Reddy  wrote:
>>
>> Can you please suggest me how to fix this issue?
>>
>> On Monday, July 11, 2022 at 11:45:25 AM UTC+5:30 skra...@gmail.com wrote:
>>
>>> You appear to be trying to do something to the /boot partition.
>>>
>>> Perhaps you are referring to the wrong device?
>>>
>>>
>>>
>>> When in trouble, or in doubt
>>> Run in circles, scream and shout
>>> On 11 July 2022, at 3:40 pm, Ashok Reddy >> > wrote:

 lsblk

 NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT

 vda252:00   50G  0 disk

 ├─vda1 252:10  500M  0 part /boot

 ├─vda2 252:204G  0 part [SWAP]

 └─vda3 252:30 10.5G  0 part /

 ---

 - hosts: default

   become: true

   become_method: sudo

   tasks:

 - name: part1

   parted:

 device: "/dev/vda1"

 number: 1

 state: present

 - name: filesystem

   filesystem:

 fstype: ext4

 dev: /dev/vda1

 - name: mounted

   mount:

 path: /opt

 src: /dev/vda1

 fstype: ext4

 state: mounted


 - name: partition

   lvg:

 vg: "datavg"

 pvs: "/dev/vda1"

 state: present

 - name: resize pv

   command: "pvresize /dev/vda1"


 - name: activate vg

   command: "vgchange -a y datavg"


 - name: Ensure

   lvol:

 vg: datavg

 lv: datalv

 size: "100%FREE"

   ignore_errors: true


 - name: sql file

   filesystem:

 dev: "/dev/datavg


 error:

 TASK [part1]
 **

 fatal: [localhost]: FAILED! => {"changed": false, "err": "Error:
 Partition(s) on /dev/vda1 are being used.\n", "msg": "Error while running
 parted script: /sbin/parted -s -m -a optimal /dev/vda1 -- unit KiB mklabel
 msdos mkpart primary 0% 100%", "out": "", "rc": 1}



 On Monday, July 11, 2022 at 10:52:11 AM UTC+5:30 Ashok Reddy wrote:

> Thanks for providing your input.
>
> On Friday, July 8, 2022 at 5:18:41 PM UTC+5:30 dnmv...@gmail.com
>  wrote:
>
>>
>>
>> On 2022-07-08 (Fri) 11:50, Ashok Reddy wrote:
>> > I am trying to create new partition.
>> > If that is not available, so that only need to create the /dev/vdb
>> > partition.
>>
>> Your logic is flawed.
>> You cannot create devices.
>> You can only create partitions on existing devices.
>>
>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/54e13f42-7926-44d1-a6f3-a2f0ae4830d9%40gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAKRLcHh0D%3DQAgUiSFUczDWNipxigE%3DmuUamk-48b_i7i6gzY1Q%40mail.gmail.com.


Re: [ansible-project] Unable to create the partition

2022-07-11 Thread David Logan
On the systems that I build, the /boot partition is simply an ext4 or xfs file 
system. I would not be trying to use logical volume manager to try to build 
/boot. 

I would also look at using a kick-start method or similar to automate the build 
and get the file systems built there rather than with ansible.

Anyway that is what I do, others may have a different method that may work 
better in your case. 

⁣When in trouble, or in doubt
Run in circles, scream and shout​

On 11 July 2022, 3:58 pm, at 3:58 pm, Ashok Reddy  wrote:
>Can you please suggest me how to fix this issue?
>
>On Monday, July 11, 2022 at 11:45:25 AM UTC+5:30 skra...@gmail.com
>wrote:
>
>> You appear to be trying to do something to the /boot partition. 
>>
>> Perhaps you are referring to the wrong device? 
>>
>>
>>
>> When in trouble, or in doubt
>> Run in circles, scream and shout
>> On 11 July 2022, at 3:40 pm, Ashok Reddy  wrote:
>>>
>>> lsblk
>>>
>>> NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
>>>
>>> vda252:00   50G  0 disk
>>>
>>> ├─vda1 252:10  500M  0 part /boot
>>>
>>> ├─vda2 252:204G  0 part [SWAP]
>>>
>>> └─vda3 252:30 10.5G  0 part /
>>>
>>> ---
>>>
>>> - hosts: default
>>>
>>>   become: true
>>>
>>>   become_method: sudo
>>>
>>>   tasks:
>>>
>>> - name: part1
>>>
>>>   parted:
>>>
>>> device: "/dev/vda1"
>>>
>>> number: 1
>>>
>>> state: present
>>>
>>> - name: filesystem
>>>
>>>   filesystem:
>>>
>>> fstype: ext4
>>>
>>> dev: /dev/vda1
>>>
>>> - name: mounted
>>>
>>>   mount:
>>>
>>> path: /opt
>>>
>>> src: /dev/vda1
>>>
>>> fstype: ext4
>>>
>>> state: mounted
>>>
>>>
>>> - name: partition
>>>
>>>   lvg:
>>>
>>> vg: "datavg"
>>>
>>> pvs: "/dev/vda1"
>>>
>>> state: present
>>>
>>> - name: resize pv
>>>
>>>   command: "pvresize /dev/vda1"
>>>
>>>
>>> - name: activate vg
>>>
>>>   command: "vgchange -a y datavg"
>>>
>>>
>>> - name: Ensure
>>>
>>>   lvol:
>>>
>>> vg: datavg
>>>
>>> lv: datalv
>>>
>>> size: "100%FREE"
>>>
>>>   ignore_errors: true
>>>
>>>
>>> - name: sql file
>>>
>>>   filesystem:
>>>
>>> dev: "/dev/datavg
>>>
>>>
>>> error:
>>>
>>> TASK [part1] 
>>>
>**
>>>
>>> fatal: [localhost]: FAILED! => {"changed": false, "err": "Error: 
>>> Partition(s) on /dev/vda1 are being used.\n", "msg": "Error while
>running 
>>> parted script: /sbin/parted -s -m -a optimal /dev/vda1 -- unit KiB
>mklabel 
>>> msdos mkpart primary 0% 100%", "out": "", "rc": 1}
>>>
>>>
>>>
>>> On Monday, July 11, 2022 at 10:52:11 AM UTC+5:30 Ashok Reddy wrote:
>>>
 Thanks for providing your input.

 On Friday, July 8, 2022 at 5:18:41 PM UTC+5:30 dnmv...@gmail.com 
  wrote:

>
>
> On 2022-07-08 (Fri) 11:50, Ashok Reddy wrote: 
> > I am trying to create new partition. 
> > If that is not available, so that only need to create the
>/dev/vdb 
> > partition. 
>
> Your logic is flawed. 
> You cannot create devices. 
> You can only create partitions on existing devices. 
>
>
>
>
>
>-- 
>You received this message because you are subscribed to the Google
>Groups "Ansible Project" group.
>To unsubscribe from this group and stop receiving emails from it, send
>an email to ansible-project+unsubscr...@googlegroups.com.
>To view this discussion on the web visit
>https://groups.google.com/d/msgid/ansible-project/376bc342-0b42-46c1-a664-d3977bf235a5n%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/54e13f42-7926-44d1-a6f3-a2f0ae4830d9%40gmail.com.


Re: [ansible-project] Unable to create the partition

2022-07-10 Thread Ashok Reddy
Can you please suggest me how to fix this issue?

On Monday, July 11, 2022 at 11:45:25 AM UTC+5:30 skra...@gmail.com wrote:

> You appear to be trying to do something to the /boot partition. 
>
> Perhaps you are referring to the wrong device? 
>
>
>
> When in trouble, or in doubt
> Run in circles, scream and shout
> On 11 July 2022, at 3:40 pm, Ashok Reddy  wrote:
>>
>> lsblk
>>
>> NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
>>
>> vda252:00   50G  0 disk
>>
>> ├─vda1 252:10  500M  0 part /boot
>>
>> ├─vda2 252:204G  0 part [SWAP]
>>
>> └─vda3 252:30 10.5G  0 part /
>>
>> ---
>>
>> - hosts: default
>>
>>   become: true
>>
>>   become_method: sudo
>>
>>   tasks:
>>
>> - name: part1
>>
>>   parted:
>>
>> device: "/dev/vda1"
>>
>> number: 1
>>
>> state: present
>>
>> - name: filesystem
>>
>>   filesystem:
>>
>> fstype: ext4
>>
>> dev: /dev/vda1
>>
>> - name: mounted
>>
>>   mount:
>>
>> path: /opt
>>
>> src: /dev/vda1
>>
>> fstype: ext4
>>
>> state: mounted
>>
>>
>> - name: partition
>>
>>   lvg:
>>
>> vg: "datavg"
>>
>> pvs: "/dev/vda1"
>>
>> state: present
>>
>> - name: resize pv
>>
>>   command: "pvresize /dev/vda1"
>>
>>
>> - name: activate vg
>>
>>   command: "vgchange -a y datavg"
>>
>>
>> - name: Ensure
>>
>>   lvol:
>>
>> vg: datavg
>>
>> lv: datalv
>>
>> size: "100%FREE"
>>
>>   ignore_errors: true
>>
>>
>> - name: sql file
>>
>>   filesystem:
>>
>> dev: "/dev/datavg
>>
>>
>> error:
>>
>> TASK [part1] 
>> **
>>
>> fatal: [localhost]: FAILED! => {"changed": false, "err": "Error: 
>> Partition(s) on /dev/vda1 are being used.\n", "msg": "Error while running 
>> parted script: /sbin/parted -s -m -a optimal /dev/vda1 -- unit KiB mklabel 
>> msdos mkpart primary 0% 100%", "out": "", "rc": 1}
>>
>>
>>
>> On Monday, July 11, 2022 at 10:52:11 AM UTC+5:30 Ashok Reddy wrote:
>>
>>> Thanks for providing your input.
>>>
>>> On Friday, July 8, 2022 at 5:18:41 PM UTC+5:30 dnmv...@gmail.com 
>>>  wrote:
>>>


 On 2022-07-08 (Fri) 11:50, Ashok Reddy wrote: 
 > I am trying to create new partition. 
 > If that is not available, so that only need to create the /dev/vdb 
 > partition. 

 Your logic is flawed. 
 You cannot create devices. 
 You can only create partitions on existing devices. 





-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/376bc342-0b42-46c1-a664-d3977bf235a5n%40googlegroups.com.


Re: [ansible-project] Unable to create the partition

2022-07-10 Thread David Logan
You appear to be trying to do something to the /boot partition. 

Perhaps you are referring to the wrong device? 



⁣When in trouble, or in doubt
Run in circles, scream and shout​

On 11 July 2022, 3:40 pm, at 3:40 pm, Ashok Reddy  wrote:
>
>
>lsblk
>
>NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
>
>vda252:00   50G  0 disk
>
>├─vda1 252:10  500M  0 part /boot
>
>├─vda2 252:204G  0 part [SWAP]
>
>└─vda3 252:30 10.5G  0 part /
>
>---
>
>- hosts: default
>
>  become: true
>
>  become_method: sudo
>
>  tasks:
>
>- name: part1
>
>  parted:
>
>device: "/dev/vda1"
>
>number: 1
>
>state: present
>
>- name: filesystem
>
>  filesystem:
>
>fstype: ext4
>
>dev: /dev/vda1
>
>- name: mounted
>
>  mount:
>
>path: /opt
>
>src: /dev/vda1
>
>fstype: ext4
>
>state: mounted
>
>
>- name: partition
>
>  lvg:
>
>vg: "datavg"
>
>pvs: "/dev/vda1"
>
>state: present
>
>- name: resize pv
>
>  command: "pvresize /dev/vda1"
>
>
>- name: activate vg
>
>  command: "vgchange -a y datavg"
>
>
>- name: Ensure
>
>  lvol:
>
>vg: datavg
>
>lv: datalv
>
>size: "100%FREE"
>
>  ignore_errors: true
>
>
>- name: sql file
>
>  filesystem:
>
>dev: "/dev/datavg
>
>
>error:
>
>TASK [part1] 
>**
>
>fatal: [localhost]: FAILED! => {"changed": false, "err": "Error: 
>Partition(s) on /dev/vda1 are being used.\n", "msg": "Error while
>running 
>parted script: /sbin/parted -s -m -a optimal /dev/vda1 -- unit KiB
>mklabel 
>msdos mkpart primary 0% 100%", "out": "", "rc": 1}
>
>
>
>On Monday, July 11, 2022 at 10:52:11 AM UTC+5:30 Ashok Reddy wrote:
>
>> Thanks for providing your input.
>>
>> On Friday, July 8, 2022 at 5:18:41 PM UTC+5:30 dnmv...@gmail.com
>wrote:
>>
>>>
>>>
>>> On 2022-07-08 (Fri) 11:50, Ashok Reddy wrote:
>>> > I am trying to create new partition.
>>> > If that is not available, so that only need to create the /dev/vdb
>
>>> > partition.
>>>
>>> Your logic is flawed.
>>> You cannot create devices.
>>> You can only create partitions on existing devices.
>>>
>>>
>>>
>>>
>
>-- 
>You received this message because you are subscribed to the Google
>Groups "Ansible Project" group.
>To unsubscribe from this group and stop receiving emails from it, send
>an email to ansible-project+unsubscr...@googlegroups.com.
>To view this discussion on the web visit
>https://groups.google.com/d/msgid/ansible-project/0601f782-eb0c-4771-9a80-3250d1100f2bn%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ab0f5461-d30d-4a1c-97e2-3062154e4519%40gmail.com.


Re: [ansible-project] Unable to create the partition

2022-07-10 Thread Ashok Reddy


lsblk

NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT

vda252:00   50G  0 disk

├─vda1 252:10  500M  0 part /boot

├─vda2 252:204G  0 part [SWAP]

└─vda3 252:30 10.5G  0 part /

---

- hosts: default

  become: true

  become_method: sudo

  tasks:

- name: part1

  parted:

device: "/dev/vda1"

number: 1

state: present

- name: filesystem

  filesystem:

fstype: ext4

dev: /dev/vda1

- name: mounted

  mount:

path: /opt

src: /dev/vda1

fstype: ext4

state: mounted


- name: partition

  lvg:

vg: "datavg"

pvs: "/dev/vda1"

state: present

- name: resize pv

  command: "pvresize /dev/vda1"


- name: activate vg

  command: "vgchange -a y datavg"


- name: Ensure

  lvol:

vg: datavg

lv: datalv

size: "100%FREE"

  ignore_errors: true


- name: sql file

  filesystem:

dev: "/dev/datavg


error:

TASK [part1] 
**

fatal: [localhost]: FAILED! => {"changed": false, "err": "Error: 
Partition(s) on /dev/vda1 are being used.\n", "msg": "Error while running 
parted script: /sbin/parted -s -m -a optimal /dev/vda1 -- unit KiB mklabel 
msdos mkpart primary 0% 100%", "out": "", "rc": 1}



On Monday, July 11, 2022 at 10:52:11 AM UTC+5:30 Ashok Reddy wrote:

> Thanks for providing your input.
>
> On Friday, July 8, 2022 at 5:18:41 PM UTC+5:30 dnmv...@gmail.com wrote:
>
>>
>>
>> On 2022-07-08 (Fri) 11:50, Ashok Reddy wrote:
>> > I am trying to create new partition.
>> > If that is not available, so that only need to create the /dev/vdb 
>> > partition.
>>
>> Your logic is flawed.
>> You cannot create devices.
>> You can only create partitions on existing devices.
>>
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0601f782-eb0c-4771-9a80-3250d1100f2bn%40googlegroups.com.


Re: [ansible-project] Unable to create the partition

2022-07-10 Thread Ashok Reddy
Thanks for providing your input.

On Friday, July 8, 2022 at 5:18:41 PM UTC+5:30 dnmv...@gmail.com wrote:

>
>
> On 2022-07-08 (Fri) 11:50, Ashok Reddy wrote:
> > I am trying to create new partition.
> > If that is not available, so that only need to create the /dev/vdb 
> > partition.
>
> Your logic is flawed.
> You cannot create devices.
> You can only create partitions on existing devices.
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b18d58ed-76e6-475b-83cd-868b08a8n%40googlegroups.com.


Re: [ansible-project] Unable to create the partition

2022-07-08 Thread Dick Visser



On 2022-07-08 (Fri) 11:50, Ashok Reddy wrote:

I am trying to create new partition.
If that is not available, so that only need to create the /dev/vdb 
partition.


Your logic is flawed.
You cannot create devices.
You can only create partitions on existing devices.



--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/02fb7229-5028-142c-3195-ca24c7cb9065%40gmail.com.


OpenPGP_0x266713D4E6EF488D.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: [ansible-project] Unable to create the partition

2022-07-08 Thread Ashok Reddy
I am trying to create new partition.
If that is not available, so that only need to create the /dev/vdb 
partition.

On Friday, July 8, 2022 at 2:06:16 PM UTC+5:30 ra...@linuxia.de wrote:

> On 08/07/2022 10:04, Ashok Reddy wrote:
> > Hi,
> > 
> > I am trying to create the partition, but got the following error:
>
> I think that the error message is clear about the problem. The device 
> doesn't exist.
>
> Regards
> Racke
>
> > 
> > ---
> > 
> > - hosts: default
> > 
> >   become: true
> > 
> >   become_method: sudo
> > 
> >   tasks:
> > 
> > - name: part1
> > 
> >   parted:
> > 
> > device: "/dev/vdb"
> > 
> > number: 1
> > 
> > state: present
> > 
> > - name: filesystem
> > 
> >   filesystem:
> > 
> > fstype: ext4
> > 
> > dev: /dev/vdb
> > 
> > - name: mounted
> > 
> >   mount:
> > 
> > path: /opt
> > 
> > src: /dev/vdb
> > 
> > fstype: ext4
> > 
> > state: mounted
> > 
> > 
> > - name: partition
> > 
> >   lvg:
> > 
> > vg: "datavg"
> > 
> > pvs: "/dev/vdb"
> > 
> > state: present
> > 
> > - name: resize pv
> > 
> >   command: "pvresize /dev/vdb"
> > 
> > 
> > - name: activate vg
> > 
> >   command: "vgchange -a y datavg"
> > 
> > 
> > - name: Ensure
> > 
> >   lvol:
> > 
> > vg: datavg
> > 
> > lv: datalv
> > 
> > size: "100%FREE"
> > 
> >   ignore_errors: true
> > 
> > 
> > - name: sql file
> > 
> >   filesystem:
> > 
> > dev: "/dev/datavg/datalv"
> > 
> > fstype: ext4
> > 
> > Error:
> > 
> > TASK [part1] 
> **
> > 
> > fatal: [localhost]: FAILED! => {"changed": false, "err": "Error: Could 
> not stat device /dev/vdb - No such file or directory.\n", "msg": "Error 
> while getting device information with parted script: '/sbin/parted -s -m 
> /dev/vdb -- unit 'KiB' print'", "out": "", "rc": 1}
> > 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Ansible Project" group.
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to ansible-proje...@googlegroups.com  ansible-proje...@googlegroups.com>.
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/3a39c550-240b-40c9-ac52-508089cd14c4n%40googlegroups.com
>  
> <
> https://groups.google.com/d/msgid/ansible-project/3a39c550-240b-40c9-ac52-508089cd14c4n%40googlegroups.com?utm_medium=email&utm_source=footer
> >.
>
>
> -- 
> Automation expert - Ansible and friends
> Linux administrator & Debian maintainer
> Perl Dancer & conference hopper
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2cbe8833-58b6-44e1-ab37-6df0c0366f60n%40googlegroups.com.


Re: [ansible-project] Unable to create the partition

2022-07-08 Thread Stefan Hornburg (Racke)

On 08/07/2022 10:04, Ashok Reddy wrote:

Hi,

I am trying to create the partition, but got the following error:


I think that the error message is clear about the problem. The device doesn't 
exist.

Regards
 Racke



---

- hosts: default

   become: true

   become_method: sudo

   tasks:

     - name: part1

       parted:

         device: "/dev/vdb"

         number: 1

         state: present

     - name: filesystem

       filesystem:

         fstype: ext4

         dev: /dev/vdb

     - name: mounted

       mount:

         path: /opt

         src: /dev/vdb

         fstype: ext4

         state: mounted


     - name: partition

       lvg:

         vg: "datavg"

         pvs: "/dev/vdb"

         state: present

     - name: resize pv

       command: "pvresize /dev/vdb"


     - name: activate vg

       command: "vgchange -a y datavg"


     - name: Ensure

       lvol:

         vg: datavg

         lv: datalv

         size: "100%FREE"

       ignore_errors: true


     - name: sql file

       filesystem:

         dev: "/dev/datavg/datalv"

         fstype: ext4

Error:

TASK [part1] 
**

fatal: [localhost]: FAILED! => {"changed": false, "err": "Error: Could not stat device /dev/vdb - No such file or directory.\n", 
"msg": "Error while getting device information with parted script: '/sbin/parted -s -m /dev/vdb -- unit 'KiB' print'", "out": 
"", "rc": 1}



--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 
ansible-project+unsubscr...@googlegroups.com 
.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3a39c550-240b-40c9-ac52-508089cd14c4n%40googlegroups.com
 
.



--
Automation expert - Ansible and friends
Linux administrator & Debian maintainer
Perl Dancer & conference hopper

--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1bf1b040-365d-a91d-6a8d-af700bf35476%40linuxia.de.


[ansible-project] Unable to create the partition

2022-07-08 Thread Ashok Reddy
Hi,

I am trying to create the partition, but got the following error:

---

- hosts: default

  become: true

  become_method: sudo

  tasks:

- name: part1

  parted:

device: "/dev/vdb"

number: 1

state: present

- name: filesystem

  filesystem:

fstype: ext4

dev: /dev/vdb

- name: mounted

  mount:

path: /opt

src: /dev/vdb

fstype: ext4

state: mounted


- name: partition

  lvg:

vg: "datavg"

pvs: "/dev/vdb"

state: present

- name: resize pv

  command: "pvresize /dev/vdb"


- name: activate vg

  command: "vgchange -a y datavg"


- name: Ensure

  lvol:

vg: datavg

lv: datalv

size: "100%FREE"

  ignore_errors: true


- name: sql file

  filesystem:

dev: "/dev/datavg/datalv"

fstype: ext4
Error:

TASK [part1] 
**

fatal: [localhost]: FAILED! => {"changed": false, "err": "Error: Could not 
stat device /dev/vdb - No such file or directory.\n", "msg": "Error while 
getting device information with parted script: '/sbin/parted -s -m /dev/vdb 
-- unit 'KiB' print'", "out": "", "rc": 1}



-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3a39c550-240b-40c9-ac52-508089cd14c4n%40googlegroups.com.